nss: upgrade to release 3.73
[LibreOffice.git] / include / drawinglayer / primitive2d / texthierarchyprimitive2d.hxx
blob36fcb70677a801f60dc670742b0cc010086eb337
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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 .
20 #pragma once
22 #include <drawinglayer/drawinglayerdllapi.h>
24 #include <drawinglayer/primitive2d/groupprimitive2d.hxx>
25 #include <rtl/ustring.hxx>
28 namespace drawinglayer::primitive2d
30 /** TextHierarchyLinePrimitive2D class
32 Text format hierarchy helper class. It decomposes to its
33 content, so all direct renderers may ignore it. If You need
34 to know more about line hierarchies You may react on it and
35 also need to take care that the source of data uses it.
37 This primitive encapsulates text lines.
39 class DRAWINGLAYER_DLLPUBLIC TextHierarchyLinePrimitive2D final : public GroupPrimitive2D
41 private:
42 public:
43 /// constructor
44 explicit TextHierarchyLinePrimitive2D(const Primitive2DContainer& rChildren);
46 /// provide unique ID
47 virtual sal_uInt32 getPrimitive2DID() const override;
50 /** TextHierarchyBulletPrimitive2D class
52 This primitive encapsulates text bullets.
54 class DRAWINGLAYER_DLLPUBLIC TextHierarchyBulletPrimitive2D final : public GroupPrimitive2D
56 private:
57 public:
58 /// constructor
59 explicit TextHierarchyBulletPrimitive2D(const Primitive2DContainer& rChildren);
61 /// provide unique ID
62 virtual sal_uInt32 getPrimitive2DID() const override;
65 /** TextHierarchyParagraphPrimitive2D class
67 This primitive encapsulates text paragraphs.
69 class DRAWINGLAYER_DLLPUBLIC TextHierarchyParagraphPrimitive2D final : public GroupPrimitive2D
71 private:
72 // outline level of the encapsulated paragraph data.
73 // -1 means no level, >= 0 is the level
74 sal_Int16 mnOutlineLevel;
76 public:
77 /// constructor
78 explicit TextHierarchyParagraphPrimitive2D(
79 const Primitive2DContainer& rChildren,
80 sal_Int16 nOutlineLevel = -1);
82 /// data read access
83 sal_Int16 getOutlineLevel() const { return mnOutlineLevel; }
85 /// compare operator
86 virtual bool operator==(const BasePrimitive2D& rPrimitive) const override;
88 /// provide unique ID
89 virtual sal_uInt32 getPrimitive2DID() const override;
92 /** TextHierarchyBlockPrimitive2D class
94 This primitive encapsulates text blocks.
96 class DRAWINGLAYER_DLLPUBLIC TextHierarchyBlockPrimitive2D final : public GroupPrimitive2D
98 private:
99 public:
100 /// constructor
101 explicit TextHierarchyBlockPrimitive2D(const Primitive2DContainer& rChildren);
103 /// provide unique ID
104 virtual sal_uInt32 getPrimitive2DID() const override;
107 /** FieldType definition */
108 enum FieldType
110 /** unspecified. If more info is needed for a FieldType,
111 create a new type and its handling
113 FIELD_TYPE_COMMON,
115 /** uses "FIELD_SEQ_BEGIN;PageField" -> special handling */
116 FIELD_TYPE_PAGE,
118 /** uses URL as string -> special handling */
119 FIELD_TYPE_URL
122 /** TextHierarchyFieldPrimitive2D class
124 This primitive encapsulates text fields.
125 Also: This type uses a type enum to transport the encapsulated field
126 type. Also added is a String which is type-dependent. E.g. for URL
127 fields, it contains the URL.
129 class DRAWINGLAYER_DLLPUBLIC TextHierarchyFieldPrimitive2D final : public GroupPrimitive2D
131 private:
132 /// field type definition
133 FieldType meType;
135 /// field data as name/value pairs (dependent of field type definition)
136 std::vector< std::pair< OUString, OUString>> meNameValue;
138 public:
139 /// constructor
140 TextHierarchyFieldPrimitive2D(
141 const Primitive2DContainer& rChildren,
142 const FieldType& rFieldType,
143 const std::vector< std::pair< OUString, OUString>>* pNameValue = nullptr);
145 /// data read access
146 FieldType getType() const { return meType; }
147 OUString getValue(const OUString& rName) const;
149 /// compare operator
150 virtual bool operator==(const BasePrimitive2D& rPrimitive) const override;
152 /// provide unique ID
153 virtual sal_uInt32 getPrimitive2DID() const override;
156 /** TextHierarchyEditPrimitive2D class
158 #i97628#
159 Primitive to encapsulate text from an active text edit; some
160 renderers need to suppress this output due to painting the
161 edited text in e.g. an OutlinerEditView. It's derived from
162 GroupPrimitive2D, so the implicit decomposition will use the
163 content. To suppress, this primitive needs to be parsed by
164 the renderer without taking any action.
166 class DRAWINGLAYER_DLLPUBLIC TextHierarchyEditPrimitive2D final : public GroupPrimitive2D
168 private:
169 public:
170 /// constructor
171 explicit TextHierarchyEditPrimitive2D(const Primitive2DContainer& rChildren);
173 /// provide unique ID
174 virtual sal_uInt32 getPrimitive2DID() const override;
176 } // end of namespace drawinglayer::primitive2d
179 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */