LibreOffice Module sw (master)  1
porftn.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 <sal/config.h>
23 
24 #include <string_view>
25 
26 #include "porfld.hxx"
27 
28 class SwTextFootnote;
29 
31 {
33  sal_uInt16 m_nOrigHeight;
34  // #i98418#
37 public:
38  SwFootnotePortion( const OUString &rExpand, SwTextFootnote *pFootnote,
39  sal_uInt16 nOrig = USHRT_MAX );
40  sal_uInt16& Orig() { return m_nOrigHeight; }
41 
42  virtual void Paint( const SwTextPaintInfo &rInf ) const override;
43  virtual bool GetExpText( const SwTextSizeInfo &rInf, OUString &rText ) const override;
44  virtual SwPosSize GetTextSize( const SwTextSizeInfo &rInfo ) const override;
45  virtual bool Format( SwTextFormatInfo &rInf ) override;
46 
47  // #i98418#
48  void SetPreferredScriptType( SwFontScript nPreferredScriptType );
49 
50  const SwTextFootnote* GetTextFootnote() const { return m_pFootnote; };
51 };
52 
54 {
55 public:
56  SwFootnoteNumPortion( const OUString &rExpand, std::unique_ptr<SwFont> pFntL )
57  : SwNumberPortion( rExpand, std::move(pFntL), true, false, 0, false )
59 };
60 
68 {
69  OUString m_aErgo;
70 public:
71  SwQuoVadisPortion( const OUString &rExp, const OUString& rStr );
72  virtual bool Format( SwTextFormatInfo &rInf ) override;
73  virtual void Paint( const SwTextPaintInfo &rInf ) const override;
74  virtual bool GetExpText( const SwTextSizeInfo &rInf, OUString &rText ) const override;
75 
76  void SetNumber( const OUString& rStr ) { m_aErgo = rStr; }
77  const OUString& GetQuoText() const { return m_aExpand; }
78  const OUString &GetContText() const { return m_aErgo; }
79 
80  // Field cloner for SplitGlue
81  virtual SwFieldPortion *Clone( const OUString &rExpand ) const override;
82 
83  // Accessibility: pass information about this portion to the PortionHandler
84  virtual void HandlePortion( SwPortionHandler& rPH ) const override;
85 };
86 
94 {
95 public:
96  SwErgoSumPortion( const OUString &rExp, std::u16string_view rStr );
97  virtual TextFrameIndex GetModelPositionForViewPoint(sal_uInt16 nOfst) const override;
98  virtual bool Format( SwTextFormatInfo &rInf ) override;
99 
100  // Field cloner for SplitGlue
101  virtual SwFieldPortion *Clone( const OUString &rExpand ) const override;
102 };
103 
104 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual SwFieldPortion * Clone(const OUString &rExpand) const override
Definition: txtftn.cxx:1473
virtual void HandlePortion(SwPortionHandler &rPH) const override
Definition: txtftn.cxx:1455
The SwPortionHandler interface implements a visitor for the layout engine's text portions.
virtual bool Format(SwTextFormatInfo &rInf) override
Definition: txtftn.cxx:1363
const SwTextFootnote * GetTextFootnote() const
Definition: porftn.hxx:50
const OUString & GetContText() const
Definition: porftn.hxx:78
const OUString & GetQuoText() const
Definition: porftn.hxx:77
bool mbPreferredScriptTypeSet
Definition: porftn.hxx:35
virtual void Paint(const SwTextPaintInfo &rInf) const override
Definition: txtftn.cxx:1460
void SetNumber(const OUString &rStr)
Definition: porftn.hxx:76
SwTextFootnote * m_pFootnote
Definition: porftn.hxx:32
virtual bool GetExpText(const SwTextSizeInfo &rInf, OUString &rText) const override
Definition: txtftn.cxx:1357
virtual SwFieldPortion * Clone(const OUString &rExpand) const override
Definition: txtftn.cxx:1406
void SetPreferredScriptType(SwFontScript nPreferredScriptType)
Definition: txtftn.cxx:1400
SwQuoVadisPortion(const OUString &rExp, const OUString &rStr)
Definition: txtftn.cxx:1411
void SetWhichPor(const PortionType nNew)
Definition: porlin.hxx:95
SwFootnoteNumPortion(const OUString &rExpand, std::unique_ptr< SwFont > pFntL)
Definition: porftn.hxx:56
OUString m_aExpand
Definition: porfld.hxx:38
SwErgoSumPortion(const OUString &rExp, std::u16string_view rStr)
Definition: txtftn.cxx:1478
virtual bool GetExpText(const SwTextSizeInfo &rInf, OUString &rText) const override
Definition: txtftn.cxx:1445
Used in footnotes if they break across pages, master has this portion at the end. ...
Definition: porftn.hxx:67
virtual SwPosSize GetTextSize(const SwTextSizeInfo &rInfo) const override
Definition: txtftn.cxx:1391
Used in footnotes if they break across pages, follow starts with this portion.
Definition: porftn.hxx:93
virtual void Paint(const SwTextPaintInfo &rInf) const override
Definition: txtftn.cxx:1382
virtual TextFrameIndex GetModelPositionForViewPoint(sal_uInt16 nOfst) const override
the parameter is actually SwTwips apparently?
Definition: txtftn.cxx:1489
sal_uInt16 m_nOrigHeight
Definition: porftn.hxx:33
sal_uInt16 & Orig()
Definition: porftn.hxx:40
SwFontScript
Definition: swfont.hxx:122
SwFontScript mnPreferredScriptType
Definition: porftn.hxx:36
SwFootnotePortion(const OUString &rExpand, SwTextFootnote *pFootnote, sal_uInt16 nOrig=USHRT_MAX)
Definition: txtftn.cxx:1344
virtual bool Format(SwTextFormatInfo &rInf) override
Definition: txtftn.cxx:1418
OUString m_aErgo
Definition: porftn.hxx:69
virtual bool Format(SwTextFormatInfo &rInf) override
Definition: txtftn.cxx:1494