Branch libreoffice-5-0-4
[LibreOffice.git] / canvas / source / directx / dx_textlayout_drawhelper.hxx
blob03f3b6def45ab3982a0fbde2f490db4765fba5fd
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_CANVAS_SOURCE_DIRECTX_DX_TEXTLAYOUT_DRAWHELPER_HXX
21 #define INCLUDED_CANVAS_SOURCE_DIRECTX_DX_TEXTLAYOUT_DRAWHELPER_HXX
23 #include <boost/shared_ptr.hpp>
25 #include <com/sun/star/uno/Sequence.hxx>
26 #include <com/sun/star/rendering/StringContext.hpp>
27 #include <com/sun/star/rendering/XCanvasFont.hpp>
28 #include <com/sun/star/geometry/Matrix2D.hpp>
29 #include <com/sun/star/rendering/XGraphicDevice.hpp>
31 #include <basegfx/matrix/b2dhommatrix.hxx>
32 #include <basegfx/vector/b2isize.hxx>
34 class ::com::sun::star::rendering::XCanvasFont;
36 namespace Gdiplus { class Graphics; }
38 namespace dxcanvas
40 struct Bitmap;
41 class TextLayoutDrawHelper
43 public:
44 TextLayoutDrawHelper(
45 const ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XGraphicDevice >& xGraphicDevice);
46 ~TextLayoutDrawHelper();
48 // draw text
49 void drawText( const boost::shared_ptr<Gdiplus::Graphics>& rGraphics,
50 const ::com::sun::star::rendering::ViewState& rViewState,
51 const ::com::sun::star::rendering::RenderState& rRenderState,
52 const ::basegfx::B2ISize& rOutputOffset,
53 const ::com::sun::star::rendering::StringContext& rText,
54 const ::com::sun::star::uno::Sequence< double >& rLogicalAdvancements,
55 const ::com::sun::star::uno::Reference<
56 ::com::sun::star::rendering::XCanvasFont >& rCanvasFont,
57 const ::com::sun::star::geometry::Matrix2D& rFontMatrix,
58 bool bAlphaSurface );
60 ::com::sun::star::geometry::RealRectangle2D queryTextBounds(
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 );
67 #ifdef DBG_UTIL
68 void test();
69 #endif
71 protected:
72 ::com::sun::star::uno::Reference<
73 ::com::sun::star::rendering::XGraphicDevice > mxGraphicDevice;
77 #endif // INCLUDED_CANVAS_SOURCE_DIRECTX_DX_TEXTLAYOUT_DRAWHELPER_HXX
79 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */