Branch data Line data Source code
1 : : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : : /*************************************************************************
3 : : *
4 : : * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 : : *
6 : : * Copyright 2000, 2010 Oracle and/or its affiliates.
7 : : *
8 : : * OpenOffice.org - a multi-platform office productivity suite
9 : : *
10 : : * This file is part of OpenOffice.org.
11 : : *
12 : : * OpenOffice.org is free software: you can redistribute it and/or modify
13 : : * it under the terms of the GNU Lesser General Public License version 3
14 : : * only, as published by the Free Software Foundation.
15 : : *
16 : : * OpenOffice.org is distributed in the hope that it will be useful,
17 : : * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 : : * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 : : * GNU Lesser General Public License version 3 for more details
20 : : * (a copy is included in the LICENSE file that accompanied this code).
21 : : *
22 : : * You should have received a copy of the GNU Lesser General Public License
23 : : * version 3 along with OpenOffice.org. If not, see
24 : : * <http://www.openoffice.org/license.html>
25 : : * for a copy of the LGPLv3 License.
26 : : *
27 : : ************************************************************************/
28 : :
29 : : #ifndef INCLUDED_DRAWINGLAYER_PRIMITIVE2D_TEXTEFFECTPRIMITIVE2D_HXX
30 : : #define INCLUDED_DRAWINGLAYER_PRIMITIVE2D_TEXTEFFECTPRIMITIVE2D_HXX
31 : :
32 : : #include <drawinglayer/drawinglayerdllapi.h>
33 : :
34 : : #include <drawinglayer/primitive2d/baseprimitive2d.hxx>
35 : : #include <basegfx/matrix/b2dhommatrix.hxx>
36 : :
37 : : //////////////////////////////////////////////////////////////////////////////
38 : :
39 : : namespace drawinglayer
40 : : {
41 : : namespace primitive2d
42 : : {
43 : : /** TextEffectStyle2D definition */
44 : : enum TextEffectStyle2D
45 : : {
46 : : TEXTEFFECTSTYLE2D_RELIEF_EMBOSSED_DEFAULT,
47 : : TEXTEFFECTSTYLE2D_RELIEF_ENGRAVED_DEFAULT,
48 : : TEXTEFFECTSTYLE2D_RELIEF_EMBOSSED,
49 : : TEXTEFFECTSTYLE2D_RELIEF_ENGRAVED,
50 : : TEXTEFFECTSTYLE2D_OUTLINE
51 : : };
52 : :
53 : : /** TextEffectPrimitive2D class
54 : :
55 : : This primitive embeds text primitives (normally, as can be seen can
56 : : also be used for any other primitives) which have some TextEffect applied
57 : : and create the needed geometry and embedding on decomposition.
58 : : */
59 [ + - ][ + - ]: 3598 : class DRAWINGLAYER_DLLPUBLIC TextEffectPrimitive2D : public BufferedDecompositionPrimitive2D
[ - + ]
60 : : {
61 : : private:
62 : : /// the text (or other) content
63 : : Primitive2DSequence maTextContent;
64 : :
65 : : /// the style to apply, the direction and the rotation center
66 : : const basegfx::B2DPoint maRotationCenter;
67 : : double mfDirection;
68 : : TextEffectStyle2D meTextEffectStyle2D;
69 : :
70 : : /** the last used object to view transformtion used from getDecomposition
71 : : for decide buffering
72 : : */
73 : : basegfx::B2DHomMatrix maLastObjectToViewTransformation;
74 : :
75 : : protected:
76 : : /// create local decomposition
77 : : virtual Primitive2DSequence create2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
78 : :
79 : : public:
80 : : /// construcor
81 : : TextEffectPrimitive2D(
82 : : const Primitive2DSequence& rTextContent,
83 : : const basegfx::B2DPoint& rRotationCenter,
84 : : double fDirection,
85 : : TextEffectStyle2D eTextEffectStyle2D);
86 : :
87 : : /// data read access
88 : 15445 : const Primitive2DSequence& getTextContent() const { return maTextContent; }
89 : 2100 : const basegfx::B2DPoint& getRotationCenter() const { return maRotationCenter; }
90 : 1050 : double getDirection() const { return mfDirection; }
91 : 2253 : TextEffectStyle2D getTextEffectStyle2D() const { return meTextEffectStyle2D; }
92 : :
93 : : /// compare operator
94 : : virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
95 : :
96 : : /** own get range implementation to solve more effective. Content is by definition displaced
97 : : by a fixed discrete unit, thus the contained geometry needs only once be asked for it's
98 : : own basegfx::B2DRange
99 : : */
100 : : virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& rViewInformation) const;
101 : :
102 : : /// provide unique ID
103 : : DeclPrimitrive2DIDBlock()
104 : :
105 : : /// Overload standard getDecomposition call to be view-dependent here
106 : : virtual Primitive2DSequence get2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
107 : : };
108 : : } // end of namespace primitive2d
109 : : } // end of namespace drawinglayer
110 : :
111 : : //////////////////////////////////////////////////////////////////////////////
112 : :
113 : : #endif //INCLUDED_DRAWINGLAYER_PRIMITIVE2D_TEXTEFFECTPRIMITIVE2D_HXX
114 : :
115 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|