1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
22 #include <drawinglayer/drawinglayerdllapi.h>
24 #include <drawinglayer/primitive2d/groupprimitive2d.hxx>
25 #include <vcl/pdfwriter.hxx>
28 namespace drawinglayer::primitive2d
30 /** StructureTagPrimitive2D class
32 This class is used to provide simple support for adding grouped
33 pdf writer structured element information like used in sd from
34 unomodel.cxx where a ViewObjectContactRedirector is used to add
35 such information for diverse objects.
36 This primitive encapsulates these and the VCLPdfRenderer uses it
37 to apply the needed infos directly to the pdf export in a compatible
39 If a renderer ignores this, it just decomposes to its child
42 class DRAWINGLAYER_DLLPUBLIC StructureTagPrimitive2D final
: public GroupPrimitive2D
45 /// the PDF structure element this grouping represents
46 vcl::PDFWriter::StructElement maStructureElement
;
48 /// flag for background object
50 /// flag for image (OBJ_GRAF)
52 /// anchor structure element (Writer)
53 sal_Int32 m_nAnchorStructureElementId
;
54 /// for Annot structure element, the ids of the annotations
55 ::std::vector
<sal_Int32
> m_AnnotIds
;
59 StructureTagPrimitive2D(
60 const vcl::PDFWriter::StructElement
& rStructureElement
,
63 Primitive2DContainer
&& aChildren
,
64 sal_Int32 nAnchorStructureElementId
= -1,
65 ::std::vector
<sal_Int32
> const* pAnnotIds
= nullptr);
68 const vcl::PDFWriter::StructElement
& getStructureElement() const { return maStructureElement
; }
69 bool isBackground() const { return mbBackground
; }
70 bool isImage() const { return mbIsImage
; }
71 bool isTaggedSdrObject() const;
72 sal_Int32
GetAnchorStructureElementId() const { return m_nAnchorStructureElementId
; }
73 ::std::vector
<sal_Int32
> GetAnnotIds() const { return m_AnnotIds
; }
76 virtual bool operator==(const BasePrimitive2D
& rPrimitive
) const override
;
79 virtual sal_uInt32
getPrimitive2DID() const override
;
81 } // end of namespace drawinglayer::primitive2d
84 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */