LibreOffice Module sw (master) 1
porexp.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
22#include "portxt.hxx"
23
25{
26public:
28 virtual bool Format( SwTextFormatInfo &rInf ) override;
29 virtual TextFrameIndex GetModelPositionForViewPoint(sal_uInt16 nOfst) const override;
30 virtual bool GetExpText( const SwTextSizeInfo &rInf, OUString &rText ) const override;
31 virtual SwPosSize GetTextSize( const SwTextSizeInfo &rInfo ) const override;
32 virtual void Paint( const SwTextPaintInfo &rInf ) const override;
33
34 // Accessibility: pass information about this portion to the PortionHandler
35 virtual void HandlePortion( SwPortionHandler& rPH ) const override;
36
37 void dumpAsXml(xmlTextWriterPtr pWriter, const OUString& rText,
38 TextFrameIndex& nOffset) const override;
39};
40
43{
45 bool m_bMulti; // For multiportion brackets
46public:
47 SwBlankPortion( sal_Unicode cCh, bool bMult = false )
48 : m_cChar( cCh ), m_bMulti( bMult )
50
51 virtual SwLinePortion *Compress() override;
52 virtual bool GetExpText( const SwTextSizeInfo &rInf, OUString &rText ) const override;
53 virtual void FormatEOL( SwTextFormatInfo &rInf ) override;
54 virtual bool Format( SwTextFormatInfo &rInf ) override;
55 virtual void Paint( const SwTextPaintInfo &rInf ) const override;
56 static sal_uInt16 MayUnderflow(const SwTextFormatInfo &rInf, TextFrameIndex nIdx,
57 bool bUnderflow );
58
59 // Accessibility: pass information about this portion to the PortionHandler
60 virtual void HandlePortion( SwPortionHandler& rPH ) const override;
61
62 void dumpAsXml(xmlTextWriterPtr pWriter, const OUString& rText,
63 TextFrameIndex& nOffset) const override;
64};
65
67{
69public:
70 explicit SwPostItsPortion( bool bScrpt );
71 virtual void Paint( const SwTextPaintInfo &rInf ) const override;
72 virtual bool Format( SwTextFormatInfo &rInf ) override;
73 virtual sal_uInt16 GetViewWidth( const SwTextSizeInfo &rInf ) const override;
74 virtual bool GetExpText( const SwTextSizeInfo &rInf, OUString &rText ) const override;
75 bool IsScript() const { return m_bScript; }
76};
77
78/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
o3tl::strong_int< sal_Int32, struct Tag_TextFrameIndex > TextFrameIndex
Denotes a character index in a text frame at a layout level, after extent mapping from a text node at...
Non-breaking space or non-breaking hyphen.
Definition: porexp.hxx:43
virtual bool GetExpText(const SwTextSizeInfo &rInf, OUString &rText) const override
Definition: porexp.cxx:251
virtual void HandlePortion(SwPortionHandler &rPH) const override
Definition: porexp.cxx:263
virtual void FormatEOL(SwTextFormatInfo &rInf) override
Format End of Line.
Definition: porexp.cxx:174
bool m_bMulti
Definition: porexp.hxx:45
void dumpAsXml(xmlTextWriterPtr pWriter, const OUString &rText, TextFrameIndex &nOffset) const override
Definition: porexp.cxx:268
virtual bool Format(SwTextFormatInfo &rInf) override
Pass on the underflows and trigger them ourselves!
Definition: porexp.cxx:196
sal_Unicode m_cChar
Definition: porexp.hxx:44
SwBlankPortion(sal_Unicode cCh, bool bMult=false)
Definition: porexp.hxx:47
static sal_uInt16 MayUnderflow(const SwTextFormatInfo &rInf, TextFrameIndex nIdx, bool bUnderflow)
If a Line is full of HardBlanks and overflows, we must not generate underflows! Causes problems with ...
Definition: porexp.cxx:118
virtual SwLinePortion * Compress() override
Definition: porexp.cxx:111
virtual void Paint(const SwTextPaintInfo &rInf) const override
Definition: porexp.cxx:209
virtual void Paint(const SwTextPaintInfo &rInf) const override
Definition: porexp.cxx:75
virtual bool GetExpText(const SwTextSizeInfo &rInf, OUString &rText) const override
Definition: porexp.cxx:29
virtual bool Format(SwTextFormatInfo &rInf) override
Definition: porexp.cxx:58
void dumpAsXml(xmlTextWriterPtr pWriter, const OUString &rText, TextFrameIndex &nOffset) const override
Definition: porexp.cxx:42
virtual TextFrameIndex GetModelPositionForViewPoint(sal_uInt16 nOfst) const override
the parameter is actually SwTwips apparently?
Definition: porexp.cxx:26
virtual SwPosSize GetTextSize(const SwTextSizeInfo &rInfo) const override
Definition: porexp.cxx:52
virtual void HandlePortion(SwPortionHandler &rPH) const override
Definition: porexp.cxx:37
Base class for anything that can be part of a line in the Writer layout.
Definition: porlin.hxx:52
void SetLen(TextFrameIndex const nLen)
Definition: porlin.hxx:78
void SetWhichPor(const PortionType nNew)
Definition: porlin.hxx:101
The SwPortionHandler interface implements a visitor for the layout engine's text portions.
bool IsScript() const
Definition: porexp.hxx:75
virtual sal_uInt16 GetViewWidth(const SwTextSizeInfo &rInf) const override
Definition: porexp.cxx:296
virtual bool GetExpText(const SwTextSizeInfo &rInf, OUString &rText) const override
Definition: porexp.cxx:311
SwPostItsPortion(bool bScrpt)
Definition: porexp.cxx:283
virtual bool Format(SwTextFormatInfo &rInf) override
Definition: porexp.cxx:302
virtual void Paint(const SwTextPaintInfo &rInf) const override
Definition: porexp.cxx:290
This portion represents a part of the paragraph string.
Definition: portxt.hxx:27
struct _xmlTextWriter * xmlTextWriterPtr
sal_uInt16 sal_Unicode