android: Update app-specific/MIME type icons
[LibreOffice.git] / sw / source / core / text / guess.hxx
blobf83c7e280ae412c2bb77e5f452add732d3e5660f
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 #pragma once
21 #include <memory>
23 #include "porrst.hxx"
25 #include <com/sun/star/uno/Reference.hxx>
27 namespace com::sun::star::linguistic2 { class XHyphenatedWord; }
29 class SwTextFormatInfo;
31 class SwTextGuess
33 css::uno::Reference< css::linguistic2::XHyphenatedWord > m_xHyphWord;
34 std::unique_ptr<SwHangingPortion> m_pHanging; // for hanging punctuation
35 TextFrameIndex m_nCutPos; // this character doesn't fit
36 TextFrameIndex m_nBreakStart; // start index of word containing line break
37 TextFrameIndex m_nBreakPos; // start index of break position
38 TextFrameIndex m_nFieldDiff; // absolute positions can be wrong if we
39 // a field in the text has been expanded
40 sal_uInt16 m_nBreakWidth; // width of the broken portion
41 sal_uInt16 m_nExtraBlankWidth; // width of spaces after the break
42 public:
43 SwTextGuess(): m_nCutPos(0), m_nBreakStart(0),
44 m_nBreakPos(0), m_nFieldDiff(0), m_nBreakWidth(0), m_nExtraBlankWidth(0)
45 { }
47 // true, if current portion still fits to current line
48 bool Guess( const SwTextPortion& rPor, SwTextFormatInfo &rInf,
49 const sal_uInt16 nHeight );
50 bool AlternativeSpelling( const SwTextFormatInfo &rInf, const TextFrameIndex nPos );
52 SwHangingPortion* GetHangingPortion() const { return m_pHanging.get(); }
53 SwHangingPortion* ReleaseHangingPortion() { return m_pHanging.release(); }
54 sal_uInt16 BreakWidth() const { return m_nBreakWidth; }
55 sal_uInt16 ExtraBlankWidth() const { return m_nExtraBlankWidth; }
56 TextFrameIndex CutPos() const { return m_nCutPos; }
57 TextFrameIndex BreakStart() const { return m_nBreakStart; }
58 TextFrameIndex BreakPos() const {return m_nBreakPos; }
59 TextFrameIndex FieldDiff() const {return m_nFieldDiff; }
60 const css::uno::Reference< css::linguistic2::XHyphenatedWord >& HyphWord() const
61 { return m_xHyphWord; }
65 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */