1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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_DRAWINGLAYER_PRIMITIVE2D_TEXTBREAKUPHELPER_HXX
21 #define INCLUDED_DRAWINGLAYER_PRIMITIVE2D_TEXTBREAKUPHELPER_HXX
23 #include <drawinglayer/drawinglayerdllapi.h>
24 #include <drawinglayer/primitive2d/textprimitive2d.hxx>
25 #include <drawinglayer/primitive2d/textlayoutdevice.hxx>
26 #include <basegfx/matrix/b2dhommatrixtools.hxx>
30 namespace drawinglayer
36 BreakupUnit_character
,
41 class DRAWINGLAYER_DLLPUBLIC TextBreakupHelper
44 const TextSimplePortionPrimitive2D
& mrSource
;
45 Primitive2DSequence mxResult
;
46 TextLayouterDevice maTextLayouter
;
47 basegfx::tools::B2DHomMatrixBufferedOnDemandDecompose maDecTrans
;
52 /// create a portion from nIndex to nLength and append to rTempResult
53 void breakupPortion(Primitive2DVector
& rTempResult
, sal_Int32 nIndex
, sal_Int32 nLength
, bool bWordLineMode
);
55 /// breakup complete primitive
56 void breakup(BreakupUnit aBreakupUnit
);
59 /// allow user callback to allow changes to the new TextTransformation. Default
60 /// does nothing. Retval defines if a primitive gets created, e.g. return false
61 /// to suppress creation
62 virtual bool allowChange(sal_uInt32 nCount
, basegfx::B2DHomMatrix
& rNewTransform
, sal_uInt32 nIndex
, sal_uInt32 nLength
);
64 /// allow read access to evtl. useful local parts
65 const TextLayouterDevice
& getTextLayouter() const { return maTextLayouter
; }
66 const basegfx::tools::B2DHomMatrixBufferedOnDemandDecompose
& getDecTrans() const { return maDecTrans
; }
67 const TextSimplePortionPrimitive2D
& getSource() const { return mrSource
; }
70 TextBreakupHelper(const TextSimplePortionPrimitive2D
& rSource
);
71 virtual ~TextBreakupHelper();
74 const Primitive2DSequence
& getResult(BreakupUnit aBreakupUnit
= BreakupUnit_character
) const;
77 } // end of namespace primitive2d
78 } // end of namespace drawinglayer
82 #endif //INCLUDED_DRAWINGLAYER_PRIMITIVE2D_TEXTBREAKUPHELPER_HXX
84 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */