LibreOffice Module drawinglayer (master) 1
texthierarchyprimitive2d.cxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
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/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
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 .
18 */
19
22
23
24using namespace com::sun::star;
25
26
28{
30 : GroupPrimitive2D(std::move(aChildren))
31 {
32 }
33
34 // provide unique ID
36 {
38 }
39
40
42 Primitive2DContainer&& aChildren,
43 sal_Int16 nOutlineLevel)
44 : GroupPrimitive2D(std::move(aChildren)),
45 mnOutlineLevel(nOutlineLevel)
46 {
47 }
48
50 {
51 if(GroupPrimitive2D::operator==(rPrimitive))
52 {
53 const TextHierarchyParagraphPrimitive2D& rCompare = static_cast<const TextHierarchyParagraphPrimitive2D&>(rPrimitive);
54
55 return (getOutlineLevel() == rCompare.getOutlineLevel());
56 }
57
58 return false;
59 }
60
61 // provide unique ID
63 {
65 }
66
67
68
70 : GroupPrimitive2D(std::move(aChildren))
71 {
72 }
73
74 // provide unique ID
76 {
78 }
79
80
82 : GroupPrimitive2D(std::move(aChildren))
83 {
84 }
85
86 // provide unique ID
88 {
90 }
91
92
94 Primitive2DContainer&& aChildren,
95 const FieldType& rFieldType,
96 const std::vector< std::pair< OUString, OUString>>* pNameValue)
97 : GroupPrimitive2D(std::move(aChildren)),
98 meType(rFieldType)
99 {
100 if (nullptr != pNameValue)
101 {
102 meNameValue = *pNameValue;
103 }
104 }
105
106 OUString TextHierarchyFieldPrimitive2D::getValue(const OUString& rName) const
107 {
108 for (const std::pair< OUString, OUString >& candidate : meNameValue)
109 {
110 if (candidate.first.equals(rName))
111 {
112 return candidate.second;
113 }
114 }
115
116 return OUString();
117 }
118
120 {
121 if(GroupPrimitive2D::operator==(rPrimitive))
122 {
123 const TextHierarchyFieldPrimitive2D& rCompare = static_cast<const TextHierarchyFieldPrimitive2D&>(rPrimitive);
124
125 return (getType() == rCompare.getType()
126 && meNameValue == rCompare.meNameValue);
127 }
128
129 return false;
130 }
131
132 // provide unique ID
134 {
136 }
137
138
141 , maContent(std::move(aContent))
142 {
143 }
144
145 // provide unique ID
147 {
149 }
150
151} // end of namespace
152
153/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
TextHierarchyBlockPrimitive2D(Primitive2DContainer &&aChildren)
constructor
virtual sal_uInt32 getPrimitive2DID() const override
provide unique ID
TextHierarchyBulletPrimitive2D(Primitive2DContainer &&aChildren)
constructor
virtual sal_uInt32 getPrimitive2DID() const override
provide unique ID
TextHierarchyEditPrimitive2D(Primitive2DContainer &&aContent)
constructor
virtual sal_uInt32 getPrimitive2DID() const override
provide unique ID
virtual sal_uInt32 getPrimitive2DID() const override
provide unique ID
TextHierarchyFieldPrimitive2D(Primitive2DContainer &&aChildren, const FieldType &rFieldType, const std::vector< std::pair< OUString, OUString > > *pNameValue=nullptr)
constructor
virtual bool operator==(const BasePrimitive2D &rPrimitive) const override
compare operator
std::vector< std::pair< OUString, OUString > > meNameValue
field data as name/value pairs (dependent of field type definition)
TextHierarchyLinePrimitive2D(Primitive2DContainer &&aChildren)
constructor
virtual sal_uInt32 getPrimitive2DID() const override
provide unique ID
TextHierarchyParagraphPrimitive2D(Primitive2DContainer &&aChildren, sal_Int16 nOutlineLevel=-1)
constructor
virtual bool operator==(const BasePrimitive2D &rPrimitive) const override
compare operator
virtual sal_uInt32 getPrimitive2DID() const override
provide unique ID
#define PRIMITIVE2D_ID_TEXTHIERARCHYBLOCKPRIMITIVE2D
#define PRIMITIVE2D_ID_TEXTHIERARCHYBULLETPRIMITIVE2D
#define PRIMITIVE2D_ID_TEXTHIERARCHYLINEPRIMITIVE2D
#define PRIMITIVE2D_ID_TEXTHIERARCHYPARAGRAPHPRIMITIVE2D
#define PRIMITIVE2D_ID_TEXTHIERARCHYEDITPRIMITIVE2D
#define PRIMITIVE2D_ID_TEXTHIERARCHYFIELDPRIMITIVE2D
RedlineType meType