xref: /AOO41X/main/cppcanvas/source/mtfrenderer/outdevstate.hxx (revision cdf0e10c4e3984b49a9502b011690b615761d4a3)
1*cdf0e10cSrcweir /*************************************************************************
2*cdf0e10cSrcweir  *
3*cdf0e10cSrcweir  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4*cdf0e10cSrcweir  *
5*cdf0e10cSrcweir  * Copyright 2000, 2010 Oracle and/or its affiliates.
6*cdf0e10cSrcweir  *
7*cdf0e10cSrcweir  * OpenOffice.org - a multi-platform office productivity suite
8*cdf0e10cSrcweir  *
9*cdf0e10cSrcweir  * This file is part of OpenOffice.org.
10*cdf0e10cSrcweir  *
11*cdf0e10cSrcweir  * OpenOffice.org is free software: you can redistribute it and/or modify
12*cdf0e10cSrcweir  * it under the terms of the GNU Lesser General Public License version 3
13*cdf0e10cSrcweir  * only, as published by the Free Software Foundation.
14*cdf0e10cSrcweir  *
15*cdf0e10cSrcweir  * OpenOffice.org is distributed in the hope that it will be useful,
16*cdf0e10cSrcweir  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17*cdf0e10cSrcweir  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18*cdf0e10cSrcweir  * GNU Lesser General Public License version 3 for more details
19*cdf0e10cSrcweir  * (a copy is included in the LICENSE file that accompanied this code).
20*cdf0e10cSrcweir  *
21*cdf0e10cSrcweir  * You should have received a copy of the GNU Lesser General Public License
22*cdf0e10cSrcweir  * version 3 along with OpenOffice.org.  If not, see
23*cdf0e10cSrcweir  * <http://www.openoffice.org/license.html>
24*cdf0e10cSrcweir  * for a copy of the LGPLv3 License.
25*cdf0e10cSrcweir  *
26*cdf0e10cSrcweir  ************************************************************************/
27*cdf0e10cSrcweir 
28*cdf0e10cSrcweir #ifndef _CPPCANVAS_OUTDEVSTATE_HXX
29*cdf0e10cSrcweir #define _CPPCANVAS_OUTDEVSTATE_HXX
30*cdf0e10cSrcweir 
31*cdf0e10cSrcweir #include <com/sun/star/uno/Reference.hxx>
32*cdf0e10cSrcweir #include <com/sun/star/uno/Sequence.hxx>
33*cdf0e10cSrcweir 
34*cdf0e10cSrcweir #ifndef _COM_SUN_STAR_RENDERING_STRINGCONTEXT_HPP__
35*cdf0e10cSrcweir #include <com/sun/star/rendering/StringContext.hpp>
36*cdf0e10cSrcweir #endif
37*cdf0e10cSrcweir #ifndef _COM_SUN_STAR_RENDERING_RENDERSTATE_HPP__
38*cdf0e10cSrcweir #include <com/sun/star/rendering/RenderState.hpp>
39*cdf0e10cSrcweir #endif
40*cdf0e10cSrcweir #ifndef _COM_SUN_STAR_RENDERING_XPOLYPOLYGON2D_HPP__
41*cdf0e10cSrcweir #include <com/sun/star/rendering/XPolyPolygon2D.hpp>
42*cdf0e10cSrcweir #endif
43*cdf0e10cSrcweir #ifndef _COM_SUN_STAR_RENDERING_XCANVASFONT_HPP__
44*cdf0e10cSrcweir #include <com/sun/star/rendering/XCanvasFont.hpp>
45*cdf0e10cSrcweir #endif
46*cdf0e10cSrcweir #ifndef _COM_SUN_STAR_RENDERING_TEXTDIRECTION_HPP__
47*cdf0e10cSrcweir #include <com/sun/star/rendering/TextDirection.hpp>
48*cdf0e10cSrcweir #endif
49*cdf0e10cSrcweir #include <basegfx/matrix/b2dhommatrix.hxx>
50*cdf0e10cSrcweir #ifndef _BGFX_POLYGON_B2DPOLYPOLGON_HXX
51*cdf0e10cSrcweir #include <basegfx/polygon/b2dpolypolygon.hxx>
52*cdf0e10cSrcweir #endif
53*cdf0e10cSrcweir #include <vcl/fntstyle.hxx>
54*cdf0e10cSrcweir #include <vcl/vclenum.hxx>
55*cdf0e10cSrcweir #include <vcl/outdev.hxx>
56*cdf0e10cSrcweir #include <vcl/outdev.hxx>
57*cdf0e10cSrcweir 
58*cdf0e10cSrcweir 
59*cdf0e10cSrcweir namespace cppcanvas
60*cdf0e10cSrcweir {
61*cdf0e10cSrcweir     namespace internal
62*cdf0e10cSrcweir     {
63*cdf0e10cSrcweir         struct OutDevState
64*cdf0e10cSrcweir         {
65*cdf0e10cSrcweir             OutDevState() :
66*cdf0e10cSrcweir                 clip(),
67*cdf0e10cSrcweir                 clipRect(),
68*cdf0e10cSrcweir                 xClipPoly(),
69*cdf0e10cSrcweir 
70*cdf0e10cSrcweir                 lineColor(),
71*cdf0e10cSrcweir                 fillColor(),
72*cdf0e10cSrcweir                 textColor(),
73*cdf0e10cSrcweir                 textFillColor(),
74*cdf0e10cSrcweir                 textLineColor(),
75*cdf0e10cSrcweir 
76*cdf0e10cSrcweir                 xFont(),
77*cdf0e10cSrcweir                 transform(),
78*cdf0e10cSrcweir                 mapModeTransform(),
79*cdf0e10cSrcweir                 fontRotation(0.0),
80*cdf0e10cSrcweir 
81*cdf0e10cSrcweir                 textEmphasisMarkStyle(EMPHASISMARK_NONE),
82*cdf0e10cSrcweir                 pushFlags(PUSH_ALL),
83*cdf0e10cSrcweir                 textDirection(::com::sun::star::rendering::TextDirection::WEAK_LEFT_TO_RIGHT),
84*cdf0e10cSrcweir                 textAlignment(0), // TODO(Q2): Synchronize with implrenderer
85*cdf0e10cSrcweir                 				  // and possibly new rendering::TextAlignment
86*cdf0e10cSrcweir                 textReliefStyle(RELIEF_NONE),
87*cdf0e10cSrcweir                 textOverlineStyle(UNDERLINE_NONE),
88*cdf0e10cSrcweir                 textUnderlineStyle(UNDERLINE_NONE),
89*cdf0e10cSrcweir                 textStrikeoutStyle(STRIKEOUT_NONE),
90*cdf0e10cSrcweir                 textReferencePoint(ALIGN_BASELINE),
91*cdf0e10cSrcweir 
92*cdf0e10cSrcweir                 isTextOutlineModeSet( false ),
93*cdf0e10cSrcweir                 isTextEffectShadowSet( false ),
94*cdf0e10cSrcweir                 isTextWordUnderlineSet( false ),
95*cdf0e10cSrcweir 
96*cdf0e10cSrcweir                 isLineColorSet( false ),
97*cdf0e10cSrcweir                 isFillColorSet( false ),
98*cdf0e10cSrcweir                 isTextFillColorSet( false ),
99*cdf0e10cSrcweir                 isTextLineColorSet( false )
100*cdf0e10cSrcweir             {
101*cdf0e10cSrcweir             }
102*cdf0e10cSrcweir 
103*cdf0e10cSrcweir             ::basegfx::B2DPolyPolygon															clip;
104*cdf0e10cSrcweir             ::Rectangle																			clipRect;
105*cdf0e10cSrcweir             ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XPolyPolygon2D > 	xClipPoly;
106*cdf0e10cSrcweir 
107*cdf0e10cSrcweir             ::com::sun::star::uno::Sequence< double >											lineColor;
108*cdf0e10cSrcweir             ::com::sun::star::uno::Sequence< double >											fillColor;
109*cdf0e10cSrcweir             ::com::sun::star::uno::Sequence< double >											textColor;
110*cdf0e10cSrcweir             ::com::sun::star::uno::Sequence< double >											textFillColor;
111*cdf0e10cSrcweir             ::com::sun::star::uno::Sequence< double >											textLineColor;
112*cdf0e10cSrcweir 
113*cdf0e10cSrcweir             /** Current font.
114*cdf0e10cSrcweir 
115*cdf0e10cSrcweir             	@attention Beware, this member can be NULL, and
116*cdf0e10cSrcweir             	nevertheless text output is generated.
117*cdf0e10cSrcweir              */
118*cdf0e10cSrcweir             ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XCanvasFont > 		xFont;
119*cdf0e10cSrcweir             ::basegfx::B2DHomMatrix																transform;
120*cdf0e10cSrcweir             ::basegfx::B2DHomMatrix																mapModeTransform;
121*cdf0e10cSrcweir             double																				fontRotation;
122*cdf0e10cSrcweir 
123*cdf0e10cSrcweir             sal_uInt16																			textEmphasisMarkStyle;
124*cdf0e10cSrcweir             sal_uInt16																			pushFlags;
125*cdf0e10cSrcweir             sal_Int8																			textDirection;
126*cdf0e10cSrcweir             sal_Int8																			textAlignment;
127*cdf0e10cSrcweir             sal_Int8																			textReliefStyle;
128*cdf0e10cSrcweir             sal_Int8																			textOverlineStyle;
129*cdf0e10cSrcweir             sal_Int8																			textUnderlineStyle;
130*cdf0e10cSrcweir             sal_Int8																			textStrikeoutStyle;
131*cdf0e10cSrcweir             TextAlign																			textReferencePoint;
132*cdf0e10cSrcweir 
133*cdf0e10cSrcweir             bool																				isTextOutlineModeSet;
134*cdf0e10cSrcweir             bool																				isTextEffectShadowSet;
135*cdf0e10cSrcweir             bool																				isTextWordUnderlineSet;
136*cdf0e10cSrcweir 
137*cdf0e10cSrcweir             bool																				isLineColorSet;
138*cdf0e10cSrcweir             bool																				isFillColorSet;
139*cdf0e10cSrcweir             bool																				isTextFillColorSet;
140*cdf0e10cSrcweir             bool																				isTextLineColorSet;
141*cdf0e10cSrcweir         };
142*cdf0e10cSrcweir     }
143*cdf0e10cSrcweir }
144*cdf0e10cSrcweir 
145*cdf0e10cSrcweir #endif /* _CPPCANVAS_OUTDEVSTATE_HXX */
146