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 {
26 public:
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
46 public:
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 {
68  bool m_bScript;
69 public:
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: */
SwBlankPortion(sal_Unicode cCh, bool bMult=false)
Definition: porexp.hxx:47
virtual void Paint(const SwTextPaintInfo &rInf) const override
Definition: porexp.cxx:74
The SwPortionHandler interface implements a visitor for the layout engine's text portions.
void SetLen(TextFrameIndex const nLen)
Definition: porlin.hxx:77
sal_uInt16 sal_Unicode
virtual void HandlePortion(SwPortionHandler &rPH) const override
Definition: porexp.cxx:36
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:114
SwPostItsPortion(bool bScrpt)
Definition: porexp.cxx:238
virtual SwLinePortion * Compress() override
Definition: porexp.cxx:107
virtual bool GetExpText(const SwTextSizeInfo &rInf, OUString &rText) const override
Definition: porexp.cxx:28
virtual void Paint(const SwTextPaintInfo &rInf) const override
Definition: porexp.cxx:245
This portion represents a part of the paragraph string.
Definition: portxt.hxx:26
void dumpAsXml(xmlTextWriterPtr pWriter, const OUString &rText, TextFrameIndex &nOffset) const override
Definition: porexp.cxx:41
bool m_bMulti
Definition: porexp.hxx:45
void SetWhichPor(const PortionType nNew)
Definition: porlin.hxx:98
virtual bool GetExpText(const SwTextSizeInfo &rInf, OUString &rText) const override
Definition: porexp.cxx:212
Non-breaking space or non-breaking hyphen.
Definition: porexp.hxx:42
virtual bool Format(SwTextFormatInfo &rInf) override
Pass on the underflows and trigger them ourselves!
Definition: porexp.cxx:192
bool IsScript() const
Definition: porexp.hxx:75
Base class for anything that can be part of a line in the Writer layout.
Definition: porlin.hxx:51
void dumpAsXml(xmlTextWriterPtr pWriter, const OUString &rText, TextFrameIndex &nOffset) const override
Definition: porexp.cxx:223
virtual TextFrameIndex GetModelPositionForViewPoint(sal_uInt16 nOfst) const override
the parameter is actually SwTwips apparently?
Definition: porexp.cxx:25
virtual sal_uInt16 GetViewWidth(const SwTextSizeInfo &rInf) const override
Definition: porexp.cxx:251
virtual void FormatEOL(SwTextFormatInfo &rInf) override
Format End of Line.
Definition: porexp.cxx:170
virtual bool GetExpText(const SwTextSizeInfo &rInf, OUString &rText) const override
Definition: porexp.cxx:266
virtual void Paint(const SwTextPaintInfo &rInf) const override
Definition: porexp.cxx:205
virtual void HandlePortion(SwPortionHandler &rPH) const override
Definition: porexp.cxx:218
struct _xmlTextWriter * xmlTextWriterPtr
sal_Unicode m_cChar
Definition: porexp.hxx:44
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...
virtual bool Format(SwTextFormatInfo &rInf) override
Definition: porexp.cxx:57
virtual SwPosSize GetTextSize(const SwTextSizeInfo &rInfo) const override
Definition: porexp.cxx:51
virtual bool Format(SwTextFormatInfo &rInf) override
Definition: porexp.cxx:257