LibreOffice Module svx (master) 1
sdrtextprimitive2d.hxx
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
20#ifndef INCLUDED_SVX_INC_SDR_PRIMITIVE2D_SDRTEXTPRIMITIVE2D_HXX
21#define INCLUDED_SVX_INC_SDR_PRIMITIVE2D_SDRTEXTPRIMITIVE2D_HXX
22
26#include <com/sun/star/drawing/XDrawPage.hpp>
27#include <editeng/outlobj.hxx>
28#include <tools/color.hxx>
30#include <tools/weakbase.h>
31#include <svx/sdtaitm.hxx>
32#include <rtl/ref.hxx>
33#include <unotools/weakref.hxx>
34
35
36// predefines
37class SdrText;
38
39
41 {
43 {
44 private:
45 // The text model data; this should later just be the OutlinerParaObject or
46 // something equal
48
49 // #i97628#
50 // The text content; now as local OutlinerParaObject copy (internally RefCounted and
51 // COW) and in exclusive, local form as needed in a primitive
53
54 // remember last VisualizingPage for which a decomposition was made. If the new target
55 // is not given or different, the decomposition needs to be potentially removed
56 // for supporting e.g. page number change on MasterPage objects or the different
57 // field renderings in SubGeometry and MasterPage node
58 css::uno::Reference< css::drawing::XDrawPage > mxLastVisualizingPage;
59
60 // remember last PageNumber for which a decomposition was made. This is only used
61 // when mbContainsPageField is true, else it is 0
63
64 // remember last PageCount for which a decomposition was made. This is only used
65 // when mbContainsPageCountField is true, else it is 0
66 sal_Int16 mnLastPageCount;
67
68 // #i101443# remember last TextBackgroundColor to decide if a new decomposition is
69 // needed because of background color change
71
72 // is there a PageNumber, Header, Footer or DateTimeField used? Evaluated at construction
76
77 protected:
78 // support for XTEXT_PAINTSHAPE_BEGIN/XTEXT_PAINTSHAPE_END Metafile comments
80
81 public:
83 const SdrText* pSdrText,
84 OutlinerParaObject aOutlinerParaObjectPtr);
85
86 // get data
87 const SdrText* getSdrText() const;
89
90 // compare operator
91 virtual bool operator==(const BasePrimitive2D& rPrimitive) const override;
92
93 // own get2DDecomposition to take aspect of decomposition with or without spell checker
94 // into account
95 virtual void get2DDecomposition(Primitive2DDecompositionVisitor& rVisitor, const geometry::ViewInformation2D& rViewInformation) const override;
96
97 // transformed clone operator
99 };
100} // end of namespace drawinglayer::primitive2d
101
102
104 {
106 {
107 private:
108 // unit contour polygon (scaled to [0.0 .. 1.0])
110
111 // complete contour polygon transform (scale, rotate, shear, translate)
113
114 // local decomposition.
115 virtual void create2DDecomposition(Primitive2DContainer& rContainer, const geometry::ViewInformation2D& aViewInformation) const override;
116
117 public:
119 const SdrText* pSdrText,
120 const OutlinerParaObject& rOutlinerParaObjectPtr,
121 basegfx::B2DPolyPolygon aUnitPolyPolygon,
122 basegfx::B2DHomMatrix aObjectTransform);
123
124 // get data
127
128 // compare operator
129 virtual bool operator==(const BasePrimitive2D& rPrimitive) const override;
130
131 // transformed clone operator
133
134 // provide unique ID
135 virtual sal_uInt32 getPrimitive2DID() const override;
136 };
137} // end of namespace drawinglayer::primitive2d
138
139
141 {
143 {
144 private:
145 // the path to use. Each paragraph will use one Polygon.
147
148 // the Fontwork parameters
150
151 // local decomposition.
152 virtual void create2DDecomposition(Primitive2DContainer& rContainer, const geometry::ViewInformation2D& aViewInformation) const override;
153
154 public:
156 const SdrText* pSdrText,
157 const OutlinerParaObject& rOutlinerParaObjectPtr,
158 basegfx::B2DPolyPolygon aPathPolyPolygon,
159 attribute::SdrFormTextAttribute aSdrFormTextAttribute);
160
161 // get data
164
165 // compare operator
166 virtual bool operator==(const BasePrimitive2D& rPrimitive) const override;
167
168 // transformed clone operator
170
171 // provide unique ID
172 virtual sal_uInt32 getPrimitive2DID() const override;
173 };
174} // end of namespace drawinglayer::primitive2d
175
176
178 {
180 {
181 private:
182 // text range transformation from unit range ([0.0 .. 1.0]) to text range
184
185 // text alignments
188
190 bool mbUnlimitedPage : 1; // force layout with no text break
191 bool mbCellText : 1; // this is a cell text as block text
192 bool mbWordWrap : 1; // for CustomShapes text layout
193
194 // local decomposition.
195 virtual void create2DDecomposition(Primitive2DContainer& rContainer, const geometry::ViewInformation2D& aViewInformation) const override;
196
197 public:
199 const SdrText* pSdrText,
200 const OutlinerParaObject& rOutlinerParaObjectPtr,
201 basegfx::B2DHomMatrix aTextRangeTransform,
202 SdrTextHorzAdjust aSdrTextHorzAdjust,
203 SdrTextVertAdjust aSdrTextVertAdjust,
204 bool bFixedCellHeight,
205 bool bUnlimitedPage,
206 bool bCellText,
207 bool bWordWrap);
208
209 // get data
213 bool isFixedCellHeight() const { return mbFixedCellHeight; }
214 bool getUnlimitedPage() const { return mbUnlimitedPage; }
215 bool getCellText() const { return mbCellText; }
216 bool getWordWrap() const { return mbWordWrap; }
217
218 // compare operator
219 virtual bool operator==(const BasePrimitive2D& rPrimitive) const override;
220
221 // transformed clone operator
223
224 // provide unique ID
225 virtual sal_uInt32 getPrimitive2DID() const override;
226 };
227} // end of namespace drawinglayer::primitive2d
228
229
231 {
233 {
234 private:
235 // text range transformation from unit range ([0.0 .. 1.0]) to text range
237
239
240 // local decomposition.
241 virtual void create2DDecomposition(Primitive2DContainer& rContainer, const geometry::ViewInformation2D& aViewInformation) const override;
242
243 public:
245 const SdrText* pSdrText,
246 const OutlinerParaObject& rOutlinerParaObjectPtr,
247 basegfx::B2DHomMatrix aTextRangeTransform,
248 bool bFixedCellHeight);
249
250 // get data
252 bool isFixedCellHeight() const { return mbFixedCellHeight; }
253
254 // compare operator
255 virtual bool operator==(const BasePrimitive2D& rPrimitive) const override;
256
257 // transformed clone operator
259
260 // provide unique ID
261 virtual sal_uInt32 getPrimitive2DID() const override;
262 };
263} // end of namespace drawinglayer::primitive2d
264
265
267 {
269 {
270 private:
271 ::basegfx::B2DHomMatrix maTextRangeTransform; // text range transformation from unit range ([0.0 .. 1.0]) to text range
272
273 bool mbWordWrap : 1; // for CustomShapes text layout
274
275 // local decomposition.
276 virtual void create2DDecomposition(Primitive2DContainer& rContainer, const geometry::ViewInformation2D& aViewInformation) const override;
277
278 public:
280 const SdrText* pSdrText,
281 const OutlinerParaObject& rOutlinerParaObjectPtr,
282 ::basegfx::B2DHomMatrix aTextRangeTransform,
283 bool bWordWrap);
284
285 // get data
287 bool getWordWrap() const { return mbWordWrap; }
288
289 // compare operator
290 virtual bool operator==(const BasePrimitive2D& rPrimitive) const override;
291
292 // transformed clone operator
293 virtual rtl::Reference<SdrTextPrimitive2D> createTransformedClone(const ::basegfx::B2DHomMatrix& rTransform) const override;
294
295 // provide unique ID
296 virtual sal_uInt32 getPrimitive2DID() const override;
297 };
298} // end of namespace drawinglayer::primitive2d
299
301 {
303 {
304 private:
305 // XXX: might have position of overflowing text
306
307 ::basegfx::B2DHomMatrix maTextRangeTransform; // text range transformation from unit range ([0.0 .. 1.0]) to text range
308
309 // local decomposition.
310 virtual void create2DDecomposition(Primitive2DContainer& rContainer, const geometry::ViewInformation2D& aViewInformation) const override;
311
312 public:
314 const SdrText* pSdrText,
315 const OutlinerParaObject& rOutlinerParaObjectPtrs,
316 ::basegfx::B2DHomMatrix aTextRangeTransform);
317
318 // get data
320 //bool getWordWrap() const { return true; } // XXX: Hack! Should have a proper implementation//
321
322 // compare operator
323 virtual bool operator==(const BasePrimitive2D& rPrimitive) const override;
324
325 // transformed clone operator
327
328 // provide unique ID
329 virtual sal_uInt32 getPrimitive2DID() const override;
330 };
331} // end of namespace drawinglayer::primitive2d
332
333
334#endif // INCLUDED_SVX_INC_SDR_PRIMITIVE2D_SDRTEXTPRIMITIVE2D_HXX
335
336/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual sal_uInt32 getPrimitive2DID() const override
virtual rtl::Reference< SdrTextPrimitive2D > createTransformedClone(const ::basegfx::B2DHomMatrix &rTransform) const override
virtual bool operator==(const BasePrimitive2D &rPrimitive) const override
virtual void create2DDecomposition(Primitive2DContainer &rContainer, const geometry::ViewInformation2D &aViewInformation) const override
const basegfx::B2DHomMatrix & getTextRangeTransform() const
SdrAutoFitTextPrimitive2D(const SdrText *pSdrText, const OutlinerParaObject &rOutlinerParaObjectPtr, ::basegfx::B2DHomMatrix aTextRangeTransform, bool bWordWrap)
virtual bool operator==(const BasePrimitive2D &rPrimitive) const override
const basegfx::B2DHomMatrix & getTextRangeTransform() const
virtual void create2DDecomposition(Primitive2DContainer &rContainer, const geometry::ViewInformation2D &aViewInformation) const override
virtual sal_uInt32 getPrimitive2DID() const override
SdrBlockTextPrimitive2D(const SdrText *pSdrText, const OutlinerParaObject &rOutlinerParaObjectPtr, basegfx::B2DHomMatrix aTextRangeTransform, SdrTextHorzAdjust aSdrTextHorzAdjust, SdrTextVertAdjust aSdrTextVertAdjust, bool bFixedCellHeight, bool bUnlimitedPage, bool bCellText, bool bWordWrap)
virtual rtl::Reference< SdrTextPrimitive2D > createTransformedClone(const basegfx::B2DHomMatrix &rTransform) const override
virtual void create2DDecomposition(Primitive2DContainer &rContainer, const geometry::ViewInformation2D &aViewInformation) const override
virtual sal_uInt32 getPrimitive2DID() const override
SdrChainedTextPrimitive2D(const SdrText *pSdrText, const OutlinerParaObject &rOutlinerParaObjectPtrs, ::basegfx::B2DHomMatrix aTextRangeTransform)
virtual bool operator==(const BasePrimitive2D &rPrimitive) const override
const basegfx::B2DHomMatrix & getTextRangeTransform() const
virtual rtl::Reference< SdrTextPrimitive2D > createTransformedClone(const basegfx::B2DHomMatrix &rTransform) const override
const basegfx::B2DPolyPolygon & getUnitPolyPolygon() const
virtual sal_uInt32 getPrimitive2DID() const override
virtual rtl::Reference< SdrTextPrimitive2D > createTransformedClone(const basegfx::B2DHomMatrix &rTransform) const override
virtual bool operator==(const BasePrimitive2D &rPrimitive) const override
virtual void create2DDecomposition(Primitive2DContainer &rContainer, const geometry::ViewInformation2D &aViewInformation) const override
SdrContourTextPrimitive2D(const SdrText *pSdrText, const OutlinerParaObject &rOutlinerParaObjectPtr, basegfx::B2DPolyPolygon aUnitPolyPolygon, basegfx::B2DHomMatrix aObjectTransform)
const basegfx::B2DHomMatrix & getObjectTransform() const
virtual rtl::Reference< SdrTextPrimitive2D > createTransformedClone(const basegfx::B2DHomMatrix &rTransform) const override
virtual void create2DDecomposition(Primitive2DContainer &rContainer, const geometry::ViewInformation2D &aViewInformation) const override
const basegfx::B2DPolyPolygon & getPathPolyPolygon() const
const attribute::SdrFormTextAttribute & getSdrFormTextAttribute() const
virtual bool operator==(const BasePrimitive2D &rPrimitive) const override
attribute::SdrFormTextAttribute maSdrFormTextAttribute
virtual sal_uInt32 getPrimitive2DID() const override
SdrPathTextPrimitive2D(const SdrText *pSdrText, const OutlinerParaObject &rOutlinerParaObjectPtr, basegfx::B2DPolyPolygon aPathPolyPolygon, attribute::SdrFormTextAttribute aSdrFormTextAttribute)
virtual sal_uInt32 getPrimitive2DID() const override
SdrStretchTextPrimitive2D(const SdrText *pSdrText, const OutlinerParaObject &rOutlinerParaObjectPtr, basegfx::B2DHomMatrix aTextRangeTransform, bool bFixedCellHeight)
const basegfx::B2DHomMatrix & getTextRangeTransform() const
virtual bool operator==(const BasePrimitive2D &rPrimitive) const override
virtual void create2DDecomposition(Primitive2DContainer &rContainer, const geometry::ViewInformation2D &aViewInformation) const override
virtual rtl::Reference< SdrTextPrimitive2D > createTransformedClone(const basegfx::B2DHomMatrix &rTransform) const override
const OutlinerParaObject & getOutlinerParaObject() const
virtual bool operator==(const BasePrimitive2D &rPrimitive) const override
virtual rtl::Reference< SdrTextPrimitive2D > createTransformedClone(const basegfx::B2DHomMatrix &rTransform) const =0
virtual void get2DDecomposition(Primitive2DDecompositionVisitor &rVisitor, const geometry::ViewInformation2D &rViewInformation) const override
static void encapsulateWithTextHierarchyBlockPrimitive2D(Primitive2DContainer &rContainer, Primitive2DContainer &&aCandidate)
SdrTextPrimitive2D(const SdrText *pSdrText, OutlinerParaObject aOutlinerParaObjectPtr)
::unotools::WeakReference< SdrText > mxSdrText
css::uno::Reference< css::drawing::XDrawPage > mxLastVisualizingPage
SdrTextVertAdjust
Definition: sdtaitm.hxx:29
SdrTextHorzAdjust
Definition: sdtaitm.hxx:53