Line data Source code
1 : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : /*
3 : * This file is part of the LibreOffice project.
4 : *
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 : *
9 : * This file incorporates work covered by the following license notice:
10 : *
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 .
18 : */
19 : #ifndef INCLUDED_SW_SOURCE_CORE_TEXT_GUESS_HXX
20 : #define INCLUDED_SW_SOURCE_CORE_TEXT_GUESS_HXX
21 : #include <com/sun/star/linguistic2/XHyphenatedWord.hpp>
22 :
23 : #include "swtypes.hxx"
24 : #include "breakit.hxx"
25 : #include "porrst.hxx"
26 :
27 : class SwTxtFormatInfo;
28 :
29 : class SwTxtGuess
30 : {
31 : ::com::sun::star::uno::Reference< ::com::sun::star::linguistic2::XHyphenatedWord > xHyphWord;
32 : SwHangingPortion *pHanging; // for hanging punctuation
33 : sal_Int32 nCutPos; // this character doesn't fit
34 : sal_Int32 nBreakStart; // start index of word containing line break
35 : sal_Int32 nBreakPos; // start index of break position
36 : sal_Int32 nFieldDiff; // absolut positions can be wrong if we
37 : // a field in the text has been expanded
38 : sal_uInt16 nBreakWidth; // width of the broken portion
39 : public:
40 161843 : inline SwTxtGuess(): pHanging( NULL ), nCutPos(0), nBreakStart(0),
41 161843 : nBreakPos(0), nFieldDiff(0), nBreakWidth(0)
42 161843 : { }
43 161843 : ~SwTxtGuess() { delete pHanging; }
44 :
45 : // true, if current portion still fits to current line
46 : bool Guess( const SwTxtPortion& rPor, SwTxtFormatInfo &rInf,
47 : const sal_uInt16 nHeight );
48 : bool AlternativeSpelling( const SwTxtFormatInfo &rInf, const sal_Int32 nPos );
49 :
50 56448 : inline SwHangingPortion* GetHangingPortion() const { return pHanging; }
51 0 : inline void ClearHangingPortion() { pHanging = NULL; }
52 211863 : inline sal_uInt16 BreakWidth() const { return nBreakWidth; }
53 6768 : inline sal_Int32 CutPos() const { return nCutPos; }
54 51208 : inline sal_Int32 BreakStart() const { return nBreakStart; }
55 271857 : inline sal_Int32 BreakPos() const {return nBreakPos; }
56 51208 : inline sal_Int32 FieldDiff() const {return nFieldDiff; }
57 54064 : inline ::com::sun::star::uno::Reference< ::com::sun::star::linguistic2::XHyphenatedWord > HyphWord() const
58 54064 : { return xHyphWord; }
59 : };
60 :
61 : #endif
62 :
63 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|