Update git submodules
[LibreOffice.git] / canvas / source / opengl / ogl_textlayout.hxx
blobd913ec3fb368fb3e9117bf5674c425cf2e48ccff
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/.
8 */
10 #pragma once
12 #include <comphelper/compbase.hxx>
14 #include <com/sun/star/rendering/XTextLayout.hpp>
16 #include "ogl_canvasfont.hxx"
19 /* Definition of TextLayout class */
21 namespace oglcanvas
23 typedef ::comphelper::WeakComponentImplHelper< css::rendering::XTextLayout > TextLayoutBaseT;
25 class TextLayout : public TextLayoutBaseT
27 public:
28 TextLayout( css::rendering::StringContext aText,
29 sal_Int8 nDirection,
30 sal_Int64 nRandomSeed,
31 CanvasFont::ImplRef rFont );
33 /// make noncopyable
34 TextLayout(const TextLayout&) = delete;
35 const TextLayout& operator=(const TextLayout&) = delete;
37 /// Dispose all internal references
38 virtual void disposing(std::unique_lock<std::mutex>& rGuard) override;
40 // XTextLayout
41 virtual css::uno::Sequence< css::uno::Reference< css::rendering::XPolyPolygon2D > > SAL_CALL queryTextShapes( ) override;
42 virtual css::uno::Sequence< css::geometry::RealRectangle2D > SAL_CALL queryInkMeasures( ) override;
43 virtual css::uno::Sequence< css::geometry::RealRectangle2D > SAL_CALL queryMeasures( ) override;
44 virtual css::uno::Sequence< double > SAL_CALL queryLogicalAdvancements( ) override;
45 virtual void SAL_CALL applyLogicalAdvancements( const css::uno::Sequence< double >& aAdvancements ) override;
46 virtual css::uno::Sequence< sal_Bool > SAL_CALL queryKashidaPositions( ) override;
47 virtual void SAL_CALL applyKashidaPositions( const css::uno::Sequence< sal_Bool >& aPositions ) override;
48 virtual css::geometry::RealRectangle2D SAL_CALL queryTextBounds( ) override;
49 virtual double SAL_CALL justify( double nSize ) override;
50 virtual double SAL_CALL combinedJustify( const css::uno::Sequence< css::uno::Reference< css::rendering::XTextLayout > >& aNextLayouts, double nSize ) override;
51 virtual css::rendering::TextHit SAL_CALL getTextHit( const css::geometry::RealPoint2D& aHitPoint ) override;
52 virtual css::rendering::Caret SAL_CALL getCaret( sal_Int32 nInsertionIndex, sal_Bool bExcludeLigatures ) override;
53 virtual sal_Int32 SAL_CALL getNextInsertionIndex( sal_Int32 nStartIndex, sal_Int32 nCaretAdvancement, sal_Bool bExcludeLigatures ) override;
54 virtual css::uno::Reference< css::rendering::XPolyPolygon2D > SAL_CALL queryVisualHighlighting( sal_Int32 nStartIndex, sal_Int32 nEndIndex ) override;
55 virtual css::uno::Reference< css::rendering::XPolyPolygon2D > SAL_CALL queryLogicalHighlighting( sal_Int32 nStartIndex, sal_Int32 nEndIndex ) override;
56 virtual double SAL_CALL getBaselineOffset( ) override;
57 virtual sal_Int8 SAL_CALL getMainTextDirection( ) override;
58 virtual css::uno::Reference< css::rendering::XCanvasFont > SAL_CALL getFont( ) override;
59 virtual css::rendering::StringContext SAL_CALL getText( ) override;
61 private:
62 css::rendering::StringContext maText;
63 css::uno::Sequence< double > maLogicalAdvancements;
64 css::uno::Sequence< sal_Bool > maKashidaPositions;
65 CanvasFont::ImplRef mpFont;
66 sal_Int8 mnTextDirection;
71 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */