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 #ifndef INCLUDED_SW_SOURCE_CORE_TEXT_POREXP_HXX
21 #define INCLUDED_SW_SOURCE_CORE_TEXT_POREXP_HXX
22 
23 #include "portxt.hxx"
24 
26 {
27 public:
29  virtual bool Format( SwTextFormatInfo &rInf ) override;
30  virtual TextFrameIndex GetCursorOfst(sal_uInt16 nOfst) const override;
31  virtual bool GetExpText( const SwTextSizeInfo &rInf, OUString &rText ) const override;
32  virtual SwPosSize GetTextSize( const SwTextSizeInfo &rInfo ) const override;
33  virtual void Paint( const SwTextPaintInfo &rInf ) const override;
34 
35  // Accessibility: pass information about this portion to the PortionHandler
36  virtual void HandlePortion( SwPortionHandler& rPH ) const override;
37 };
38 
40 {
42  bool const m_bMulti; // For multiportion brackets
43 public:
44  SwBlankPortion( sal_Unicode cCh, bool bMult = false )
45  : m_cChar( cCh ), m_bMulti( bMult )
46  { m_cChar = cCh; SetLen(TextFrameIndex(1)); SetWhichPor( PortionType::Blank ); }
47 
48  virtual SwLinePortion *Compress() override;
49  virtual bool GetExpText( const SwTextSizeInfo &rInf, OUString &rText ) const override;
50  virtual void FormatEOL( SwTextFormatInfo &rInf ) override;
51  virtual bool Format( SwTextFormatInfo &rInf ) override;
52  virtual void Paint( const SwTextPaintInfo &rInf ) const override;
53  static sal_uInt16 MayUnderflow(const SwTextFormatInfo &rInf, TextFrameIndex nIdx,
54  bool bUnderflow );
55 
56  // Accessibility: pass information about this portion to the PortionHandler
57  virtual void HandlePortion( SwPortionHandler& rPH ) const override;
58 };
59 
61 {
62  bool const bScript;
63 public:
64  explicit SwPostItsPortion( bool bScrpt );
65  virtual void Paint( const SwTextPaintInfo &rInf ) const override;
66  virtual bool Format( SwTextFormatInfo &rInf ) override;
67  virtual sal_uInt16 GetViewWidth( const SwTextSizeInfo &rInf ) const override;
68  virtual bool GetExpText( const SwTextSizeInfo &rInf, OUString &rText ) const override;
69  bool IsScript() const { return bScript; }
70 };
71 
72 #endif
73 
74 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
SwBlankPortion(sal_Unicode cCh, bool bMult=false)
Definition: porexp.hxx:44
virtual TextFrameIndex GetCursorOfst(sal_uInt16 nOfst) const override
the parameter is actually SwTwips apparently?
Definition: porexp.cxx:25
virtual void Paint(const SwTextPaintInfo &rInf) const override
Definition: porexp.cxx:64
The SwPortionHandler interface implements a visitor for the layout engine's text portions.
void SetLen(TextFrameIndex const nLen)
Definition: porlin.hxx:74
bool const m_bMulti
Definition: porexp.hxx:42
sal_uInt16 sal_Unicode
virtual void HandlePortion(SwPortionHandler &rPH) const override
Definition: porexp.cxx:36
bool const bScript
Definition: porexp.hxx:62
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:104
SwPostItsPortion(bool bScrpt)
Definition: porexp.cxx:213
virtual SwLinePortion * Compress() override
Definition: porexp.cxx:97
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:220
This portion represents a part of the paragraph string.
Definition: portxt.hxx:27
void SetWhichPor(const PortionType nNew)
Definition: porlin.hxx:93
virtual bool GetExpText(const SwTextSizeInfo &rInf, OUString &rText) const override
Definition: porexp.cxx:202
virtual bool Format(SwTextFormatInfo &rInf) override
Pass on the underflows and trigger them ourselves!
Definition: porexp.cxx:182
bool IsScript() const
Definition: porexp.hxx:69
Base class for anything that can be part of a line in the Writer layout.
Definition: porlin.hxx:49
virtual sal_uInt16 GetViewWidth(const SwTextSizeInfo &rInf) const override
Definition: porexp.cxx:226
virtual void FormatEOL(SwTextFormatInfo &rInf) override
Format End of Line.
Definition: porexp.cxx:160
virtual bool GetExpText(const SwTextSizeInfo &rInf, OUString &rText) const override
Definition: porexp.cxx:241
virtual void Paint(const SwTextPaintInfo &rInf) const override
Definition: porexp.cxx:195
virtual void HandlePortion(SwPortionHandler &rPH) const override
Definition: porexp.cxx:208
sal_Unicode m_cChar
Definition: porexp.hxx:41
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:47
virtual SwPosSize GetTextSize(const SwTextSizeInfo &rInfo) const override
Definition: porexp.cxx:41
virtual bool Format(SwTextFormatInfo &rInf) override
Definition: porexp.cxx:232