CWS-TOOLING: integrate CWS os146
[LibreOffice.git] / canvas / source / directx / dx_textlayout_drawhelper.hxx
blobc484867055af92b13f87d252d04fd7ba28ee9121
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2000, 2010 Oracle and/or its affiliates.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * This file is part of OpenOffice.org.
11 * OpenOffice.org is free software: you can redistribute it and/or modify
12 * it under the terms of the GNU Lesser General Public License version 3
13 * only, as published by the Free Software Foundation.
15 * OpenOffice.org is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU Lesser General Public License version 3 for more details
19 * (a copy is included in the LICENSE file that accompanied this code).
21 * You should have received a copy of the GNU Lesser General Public License
22 * version 3 along with OpenOffice.org. If not, see
23 * <http://www.openoffice.org/license.html>
24 * for a copy of the LGPLv3 License.
26 ************************************************************************/
28 #ifndef _TEXTLAYOUT_DRAWHELPER_HXX
29 #define _TEXTLAYOUT_DRAWHELPER_HXX
31 #include <boost/shared_ptr.hpp>
33 #include <com/sun/star/uno/Sequence.hxx>
34 #include <com/sun/star/rendering/StringContext.hpp>
35 #include <com/sun/star/rendering/XCanvasFont.hpp>
36 #include <com/sun/star/geometry/Matrix2D.hpp>
37 #include <com/sun/star/rendering/XGraphicDevice.hpp>
39 #include <basegfx/matrix/b2dhommatrix.hxx>
40 #include <basegfx/vector/b2isize.hxx>
42 class ::com::sun::star::rendering::XCanvasFont;
44 namespace Gdiplus { class Graphics; }
46 namespace dxcanvas
48 struct Bitmap;
49 class TextLayoutDrawHelper
51 public:
52 TextLayoutDrawHelper(
53 const ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XGraphicDevice >& xGraphicDevice);
54 ~TextLayoutDrawHelper();
56 // draw text
57 void drawText( const boost::shared_ptr<Gdiplus::Graphics>& rGraphics,
58 const ::com::sun::star::rendering::ViewState& rViewState,
59 const ::com::sun::star::rendering::RenderState& rRenderState,
60 const ::basegfx::B2ISize& rOutputOffset,
61 const ::com::sun::star::rendering::StringContext& rText,
62 const ::com::sun::star::uno::Sequence< double >& rLogicalAdvancements,
63 const ::com::sun::star::uno::Reference<
64 ::com::sun::star::rendering::XCanvasFont >& rCanvasFont,
65 const ::com::sun::star::geometry::Matrix2D& rFontMatrix,
66 bool bAlphaSurface );
68 ::com::sun::star::geometry::RealRectangle2D queryTextBounds(
69 const ::com::sun::star::rendering::StringContext& rText,
70 const ::com::sun::star::uno::Sequence< double >& rLogicalAdvancements,
71 const ::com::sun::star::uno::Reference<
72 ::com::sun::star::rendering::XCanvasFont >& rCanvasFont,
73 const ::com::sun::star::geometry::Matrix2D& rFontMatrix );
75 #ifdef DBG_UTIL
76 void test();
77 #endif
79 protected:
80 ::com::sun::star::uno::Reference<
81 ::com::sun::star::rendering::XGraphicDevice > mxGraphicDevice;
85 #endif /* _TEXTLAYOUT_DRAWHELPER_HXX */
86 // eof