build fix: no comphelper/profilezone.hxx in this branch
[LibreOffice.git] / include / drawinglayer / primitive2d / texteffectprimitive2d.hxx
blob733234ff6369a75d6aeb897709c43ab4646d912a
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 #ifndef INCLUDED_DRAWINGLAYER_PRIMITIVE2D_TEXTEFFECTPRIMITIVE2D_HXX
21 #define INCLUDED_DRAWINGLAYER_PRIMITIVE2D_TEXTEFFECTPRIMITIVE2D_HXX
23 #include <drawinglayer/drawinglayerdllapi.h>
25 #include <drawinglayer/primitive2d/baseprimitive2d.hxx>
26 #include <basegfx/matrix/b2dhommatrix.hxx>
29 namespace drawinglayer
31 namespace primitive2d
33 /** TextEffectStyle2D definition */
34 enum class TextEffectStyle2D
36 ReliefEmbossedDefault,
37 ReliefEngravedDefault,
38 ReliefEmbossed,
39 ReliefEngraved,
40 Outline
43 /** TextEffectPrimitive2D class
45 This primitive embeds text primitives (normally, as can be seen can
46 also be used for any other primitives) which have some TextEffect applied
47 and create the needed geometry and embedding on decomposition.
49 class DRAWINGLAYER_DLLPUBLIC TextEffectPrimitive2D : public BufferedDecompositionPrimitive2D
51 private:
52 /// the text (or other) content
53 Primitive2DContainer maTextContent;
55 /// the style to apply, the direction and the rotation center
56 const basegfx::B2DPoint maRotationCenter;
57 double mfDirection;
58 TextEffectStyle2D meTextEffectStyle2D;
60 /** the last used object to view transformtion used from getDecomposition
61 for decide buffering
63 basegfx::B2DHomMatrix maLastObjectToViewTransformation;
65 protected:
66 /// create local decomposition
67 virtual void create2DDecomposition(Primitive2DContainer& rContainer, const geometry::ViewInformation2D& rViewInformation) const override;
69 public:
70 /// constructor
71 TextEffectPrimitive2D(
72 const Primitive2DContainer& rTextContent,
73 const basegfx::B2DPoint& rRotationCenter,
74 double fDirection,
75 TextEffectStyle2D eTextEffectStyle2D);
77 /// data read access
78 const Primitive2DContainer& getTextContent() const { return maTextContent; }
79 const basegfx::B2DPoint& getRotationCenter() const { return maRotationCenter; }
80 double getDirection() const { return mfDirection; }
81 TextEffectStyle2D getTextEffectStyle2D() const { return meTextEffectStyle2D; }
83 /// compare operator
84 virtual bool operator==(const BasePrimitive2D& rPrimitive) const override;
86 /** own get range implementation to solve more effective. Content is by definition displaced
87 by a fixed discrete unit, thus the contained geometry needs only once be asked for its
88 own basegfx::B2DRange
90 virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& rViewInformation) const override;
92 /// provide unique ID
93 DeclPrimitive2DIDBlock()
95 /// Override standard getDecomposition to be view-dependent here
96 virtual void get2DDecomposition(Primitive2DContainer& rContainer, const geometry::ViewInformation2D& rViewInformation) const override;
98 } // end of namespace primitive2d
99 } // end of namespace drawinglayer
102 #endif //INCLUDED_DRAWINGLAYER_PRIMITIVE2D_TEXTEFFECTPRIMITIVE2D_HXX
104 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */