LibreOffice Module sw (master) 1
guess.hxx
Go to the documentation of this file.
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
20#pragma once
21#include <memory>
22
23#include "porrst.hxx"
24
25#include <com/sun/star/uno/Reference.hxx>
26
27namespace com::sun::star::linguistic2 { class XHyphenatedWord; }
28
30
32{
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
42public:
45 { }
46
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 );
51
54 sal_uInt16 BreakWidth() const { return m_nBreakWidth; }
55 sal_uInt16 ExtraBlankWidth() const { return m_nExtraBlankWidth; }
56 TextFrameIndex CutPos() const { return m_nCutPos; }
60 const css::uno::Reference< css::linguistic2::XHyphenatedWord >& HyphWord() const
61 { return m_xHyphWord; }
62};
63
64
65/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
bool AlternativeSpelling(const SwTextFormatInfo &rInf, const TextFrameIndex nPos)
Definition: guess.cxx:672
SwHangingPortion * GetHangingPortion() const
Definition: guess.hxx:52
sal_uInt16 m_nExtraBlankWidth
Definition: guess.hxx:41
TextFrameIndex FieldDiff() const
Definition: guess.hxx:59
sal_uInt16 BreakWidth() const
Definition: guess.hxx:54
sal_uInt16 m_nBreakWidth
Definition: guess.hxx:40
TextFrameIndex m_nBreakPos
Definition: guess.hxx:37
std::unique_ptr< SwHangingPortion > m_pHanging
Definition: guess.hxx:34
TextFrameIndex m_nBreakStart
Definition: guess.hxx:36
SwHangingPortion * ReleaseHangingPortion()
Definition: guess.hxx:53
TextFrameIndex BreakStart() const
Definition: guess.hxx:57
css::uno::Reference< css::linguistic2::XHyphenatedWord > m_xHyphWord
Definition: guess.hxx:33
const css::uno::Reference< css::linguistic2::XHyphenatedWord > & HyphWord() const
Definition: guess.hxx:60
TextFrameIndex CutPos() const
Definition: guess.hxx:56
TextFrameIndex BreakPos() const
Definition: guess.hxx:58
bool Guess(const SwTextPortion &rPor, SwTextFormatInfo &rInf, const sal_uInt16 nHeight)
Definition: guess.cxx:52
SwTextGuess()
Definition: guess.hxx:43
sal_uInt16 ExtraBlankWidth() const
Definition: guess.hxx:55
TextFrameIndex m_nCutPos
Definition: guess.hxx:35
TextFrameIndex m_nFieldDiff
Definition: guess.hxx:38
This portion represents a part of the paragraph string.
Definition: portxt.hxx:27