Branch data Line data Source code
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_SDR_PRIMITIVE2D_SDCUSTOMSHAPEPRIMITIVE2D_HXX
21 : : #define INCLUDED_SDR_PRIMITIVE2D_SDCUSTOMSHAPEPRIMITIVE2D_HXX
22 : :
23 : : #include <drawinglayer/primitive2d/baseprimitive2d.hxx>
24 : : #include <basegfx/matrix/b2dhommatrix.hxx>
25 : : #include <svx/sdr/attribute/sdrshadowtextattribute.hxx>
26 : :
27 : : //////////////////////////////////////////////////////////////////////////////
28 : : // predefines
29 : :
30 : : //////////////////////////////////////////////////////////////////////////////
31 : :
32 : : namespace drawinglayer
33 : : {
34 : : namespace primitive2d
35 : : {
36 [ + - ][ + - ]: 36 : class SdrCustomShapePrimitive2D : public BufferedDecompositionPrimitive2D
[ + - ][ - + ]
37 : : {
38 : : private:
39 : : attribute::SdrShadowTextAttribute maSdrSTAttribute;
40 : : Primitive2DSequence maSubPrimitives;
41 : : basegfx::B2DHomMatrix maTextBox;
42 : :
43 : : // bitfield
44 : : // defines if SdrTextWordWrapItem was set at SdrObjCustomShape which means
45 : : // that the text needs to be block formatted
46 : : unsigned mbWordWrap : 1;
47 : :
48 : : // defines that the object contains/is a 3D AutoShape. Needed for
49 : : // making exceptions with shadow generation
50 : : unsigned mb3DShape : 1;
51 : :
52 : : // #SJ# Allow text clipping against TextBox in special cases (used for SC)
53 : : unsigned mbForceTextClipToTextRange : 1;
54 : :
55 : : protected:
56 : : // local decomposition.
57 : : virtual Primitive2DSequence create2DDecomposition(const geometry::ViewInformation2D& aViewInformation) const;
58 : :
59 : : public:
60 : : SdrCustomShapePrimitive2D(
61 : : const attribute::SdrShadowTextAttribute& rSdrSTAttribute,
62 : : const Primitive2DSequence& rSubPrimitives,
63 : : const basegfx::B2DHomMatrix& rTextBox,
64 : : bool bWordWrap,
65 : : bool b3DShape,
66 : : bool bForceTextClipToTextRange);
67 : :
68 : : // data access
69 : 72 : const attribute::SdrShadowTextAttribute& getSdrSTAttribute() const { return maSdrSTAttribute; }
70 : 36 : const Primitive2DSequence& getSubPrimitives() const { return maSubPrimitives; }
71 : 36 : const basegfx::B2DHomMatrix& getTextBox() const { return maTextBox; }
72 : 18 : bool getWordWrap() const { return mbWordWrap; }
73 : 0 : bool get3DShape() const { return mb3DShape; }
74 : 18 : bool isForceTextClipToTextRange() const { return mbForceTextClipToTextRange; }
75 : :
76 : : // compare operator
77 : : virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
78 : :
79 : : // provide unique ID
80 : : DeclPrimitrive2DIDBlock()
81 : : };
82 : : } // end of namespace primitive2d
83 : : } // end of namespace drawinglayer
84 : :
85 : : //////////////////////////////////////////////////////////////////////////////
86 : :
87 : : #endif //INCLUDED_SDR_PRIMITIVE2D_SDCUSTOMSHAPEPRIMITIVE2D_HXX
88 : :
89 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|