diff options
author | Armin Weiss <aw@openoffice.org> | 2008-03-06 03:37:06 +0000 |
---|---|---|
committer | Armin Weiss <aw@openoffice.org> | 2008-03-06 03:37:06 +0000 |
commit | 807dd3bfeafb2ec63bce04f9cc38efe481afe6ff (patch) | |
tree | ee50981768e50798e876367383e75bbcccb9cf6b /drawinglayer | |
parent | 3b78c15165be1c1f58fa36050d844e46d5331013 (diff) |
added support for structured pdf tags
Diffstat (limited to 'drawinglayer')
6 files changed, 199 insertions, 6 deletions
diff --git a/drawinglayer/inc/drawinglayer/primitive2d/drawinglayer_primitivetypes2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/drawinglayer_primitivetypes2d.hxx index 3daebaec28ba..48ebd67a0831 100644 --- a/drawinglayer/inc/drawinglayer/primitive2d/drawinglayer_primitivetypes2d.hxx +++ b/drawinglayer/inc/drawinglayer/primitive2d/drawinglayer_primitivetypes2d.hxx @@ -4,9 +4,9 @@ * * $RCSfile: drawinglayer_primitivetypes2d.hxx,v $ * - * $Revision: 1.12 $ + * $Revision: 1.13 $ * - * last change: $Author: aw $ $Date: 2008-03-05 08:20:14 $ + * last change: $Author: aw $ $Date: 2008-03-06 04:36:36 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -97,6 +97,7 @@ #define PRIMITIVE2D_ID_EXECUTEPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 46) #define PRIMITIVE2D_ID_PAGEPREVIEWPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 47) #define PRIMITIVE2D_ID_CHARTPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 48) +#define PRIMITIVE2D_ID_STRUCTURETAGRIMITIVE2D (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 49) ////////////////////////////////////////////////////////////////////////////// diff --git a/drawinglayer/inc/drawinglayer/primitive2d/structuretagprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/structuretagprimitive2d.hxx new file mode 100644 index 000000000000..3780d651a6ab --- /dev/null +++ b/drawinglayer/inc/drawinglayer/primitive2d/structuretagprimitive2d.hxx @@ -0,0 +1,87 @@ +/************************************************************************* + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: structuretagprimitive2d.hxx,v $ + * + * $Revision: 1.1 $ + * + * last change: $Author: aw $ $Date: 2008-03-06 04:36:36 $ + * + * The Contents of this file are made available subject to + * the terms of GNU Lesser General Public License Version 2.1. + * + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2005 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * 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., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + ************************************************************************/ + +#ifndef INCLUDED_DRAWINGLAYER_PRIMITIVE2D_STRUCTURETAGPRIMITIVE2D_HXX +#define INCLUDED_DRAWINGLAYER_PRIMITIVE2D_STRUCTURETAGPRIMITIVE2D_HXX + +#ifndef INCLUDED_DRAWINGLAYER_PRIMITIVE2D_GROUPPRIMITIVE2D_HXX +#include <drawinglayer/primitive2d/groupprimitive2d.hxx> +#endif + +#ifndef _VCL_PDFWRITER_HXX +#include <vcl/pdfwriter.hxx> +#endif + +////////////////////////////////////////////////////////////////////////////// + +namespace drawinglayer +{ + namespace primitive2d + { + // 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 StructureTagPrimitive2D : public GroupPrimitive2D + { + private: + // the PDF structure element this grouping represents + vcl::PDFWriter::StructElement maStructureElement; + + public: + StructureTagPrimitive2D( + const vcl::PDFWriter::StructElement& rStructureElement, + const Primitive2DSequence& rChildren); + + // data 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 + +////////////////////////////////////////////////////////////////////////////// +// eof diff --git a/drawinglayer/prj/d.lst b/drawinglayer/prj/d.lst index 33c18957b26c..51b228a487ac 100644 --- a/drawinglayer/prj/d.lst +++ b/drawinglayer/prj/d.lst @@ -34,6 +34,7 @@ mkdir: %_DEST%\inc%_EXT%\drawinglayer\primitive2d ..\inc\drawinglayer\primitive2d\polypolygonprimitive2d.hxx %_DEST%\inc%_EXT%\drawinglayer\primitive2d\polypolygonprimitive2d.hxx ..\inc\drawinglayer\primitive2d\sceneprimitive2d.hxx %_DEST%\inc%_EXT%\drawinglayer\primitive2d\sceneprimitive2d.hxx ..\inc\drawinglayer\primitive2d\shadowprimitive2d.hxx %_DEST%\inc%_EXT%\drawinglayer\primitive2d\shadowprimitive2d.hxx +..\inc\drawinglayer\primitive2d\structuretagprimitive2d.hxx %_DEST%\inc%_EXT%\drawinglayer\primitive2d\structuretagprimitive2d.hxx ..\inc\drawinglayer\primitive2d\texteffectprimitive2d.hxx %_DEST%\inc%_EXT%\drawinglayer\primitive2d\texteffectprimitive2d.hxx ..\inc\drawinglayer\primitive2d\textlayoutdevice.hxx %_DEST%\inc%_EXT%\drawinglayer\primitive2d\textlayoutdevice.hxx ..\inc\drawinglayer\primitive2d\textprimitive2d.hxx %_DEST%\inc%_EXT%\drawinglayer\primitive2d\textprimitive2d.hxx diff --git a/drawinglayer/source/primitive2d/makefile.mk b/drawinglayer/source/primitive2d/makefile.mk index 0e6b5d258cc6..3d95e6fd4f39 100644 --- a/drawinglayer/source/primitive2d/makefile.mk +++ b/drawinglayer/source/primitive2d/makefile.mk @@ -4,9 +4,9 @@ # # $RCSfile: makefile.mk,v $ # -# $Revision: 1.11 $ +# $Revision: 1.12 $ # -# last change: $Author: aw $ $Date: 2008-03-05 08:20:32 $ +# last change: $Author: aw $ $Date: 2008-03-06 04:36:46 $ # # The Contents of this file are made available subject to # the terms of GNU Lesser General Public License Version 2.1. @@ -71,6 +71,7 @@ SLOFILES= \ $(SLO)$/polygonprimitive2d.obj \ $(SLO)$/sceneprimitive2d.obj \ $(SLO)$/shadowprimitive2d.obj \ + $(SLO)$/structuretagprimitive2d.obj \ $(SLO)$/texteffectprimitive2d.obj \ $(SLO)$/textlayoutdevice.obj \ $(SLO)$/textprimitive2d.obj \ diff --git a/drawinglayer/source/primitive2d/structuretagprimitive2d.cxx b/drawinglayer/source/primitive2d/structuretagprimitive2d.cxx new file mode 100644 index 000000000000..faf17a9d3ad4 --- /dev/null +++ b/drawinglayer/source/primitive2d/structuretagprimitive2d.cxx @@ -0,0 +1,72 @@ +/************************************************************************* + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: structuretagprimitive2d.cxx,v $ + * + * $Revision: 1.1 $ + * + * last change: $Author: aw $ $Date: 2008-03-06 04:36:46 $ + * + * The Contents of this file are made available subject to + * the terms of GNU Lesser General Public License Version 2.1. + * + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2005 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * 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., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + ************************************************************************/ + +// MARKER(update_precomp.py): autogen include statement, do not remove +#include "precompiled_drawinglayer.hxx" + +#ifndef INCLUDED_DRAWINGLAYER_PRIMITIVE2D_STRUCTURETAGPRIMITIVE2D_HXX +#include <drawinglayer/primitive2d/structuretagprimitive2d.hxx> +#endif + +#ifndef INCLUDED_DRAWINGLAYER_PRIMITIVE2D_PRIMITIVETYPES2D_HXX +#include <drawinglayer/primitive2d/drawinglayer_primitivetypes2d.hxx> +#endif + +////////////////////////////////////////////////////////////////////////////// + +using namespace com::sun::star; + +////////////////////////////////////////////////////////////////////////////// + +namespace drawinglayer +{ + namespace primitive2d + { + StructureTagPrimitive2D::StructureTagPrimitive2D( + const vcl::PDFWriter::StructElement& rStructureElement, + const Primitive2DSequence& rChildren) + : GroupPrimitive2D(rChildren), + maStructureElement(rStructureElement) + { + } + + // provide unique ID + ImplPrimitrive2DIDBlock(StructureTagPrimitive2D, PRIMITIVE2D_ID_STRUCTURETAGRIMITIVE2D) + + } // end of namespace primitive2d +} // end of namespace drawinglayer + +////////////////////////////////////////////////////////////////////////////// +// eof diff --git a/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx b/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx index b1a952db01fe..cabb402fad17 100644 --- a/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx +++ b/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx @@ -4,9 +4,9 @@ * * $RCSfile: vclmetafileprocessor2d.cxx,v $ * - * $Revision: 1.19 $ + * $Revision: 1.20 $ * - * last change: $Author: aw $ $Date: 2008-03-05 09:15:45 $ + * last change: $Author: aw $ $Date: 2008-03-06 04:36:46 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -210,6 +210,13 @@ #endif ////////////////////////////////////////////////////////////////////////////// +// for StructureTagPrimitive support in sd's unomodel.cxx + +#ifndef INCLUDED_DRAWINGLAYER_PRIMITIVE2D_STRUCTURETAGPRIMITIVE2D_HXX +#include <drawinglayer/primitive2d/structuretagprimitive2d.hxx> +#endif + +////////////////////////////////////////////////////////////////////////////// namespace drawinglayer { @@ -1715,6 +1722,30 @@ namespace drawinglayer RenderChartPrimitive2D(static_cast< const primitive2d::ChartPrimitive2D& >(rCandidate), false); break; } + case PRIMITIVE2D_ID_STRUCTURETAGRIMITIVE2D : + { + // structured tag primitive + const primitive2d::StructureTagPrimitive2D& rStructureTagCandidate = static_cast< const primitive2d::StructureTagPrimitive2D& >(rCandidate); + const vcl::PDFWriter::StructElement& rTagElement(rStructureTagCandidate.getStructureElement()); + const bool bTagUsed(vcl::PDFWriter::NonStructElement != rTagElement); + + if(mpPDFExtOutDevData && bTagUsed) + { + // write start tag + mpPDFExtOutDevData->BeginStructureElement(rTagElement); + } + + // proccess childs normally + process(rStructureTagCandidate.getChildren()); + + if(mpPDFExtOutDevData && bTagUsed) + { + // write end tag + mpPDFExtOutDevData->EndStructureElement(); + } + + break; + } default : { // process recursively |