android: Update app-specific/MIME type icons
[LibreOffice.git] / sw / source / core / text / porftn.hxx
blob925a04f7793bf5c3c411bac306dcaeecb998f865
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
20 #pragma once
22 #include <sal/config.h>
24 #include <string_view>
26 #include "porfld.hxx"
28 class SwTextFootnote;
30 class SwFootnotePortion : public SwFieldPortion
32 SwTextFootnote *m_pFootnote;
33 sal_uInt16 m_nOrigHeight;
34 // #i98418#
35 bool mbPreferredScriptTypeSet;
36 SwFontScript mnPreferredScriptType;
37 public:
38 SwFootnotePortion( const OUString &rExpand, SwTextFootnote *pFootnote,
39 sal_uInt16 nOrig = USHRT_MAX );
40 sal_uInt16& Orig() { return m_nOrigHeight; }
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;
47 // #i98418#
48 void SetPreferredScriptType( SwFontScript nPreferredScriptType );
50 const SwTextFootnote* GetTextFootnote() const { return m_pFootnote; };
53 class SwFootnoteNumPortion : public SwNumberPortion
55 public:
56 SwFootnoteNumPortion( const OUString &rExpand, std::unique_ptr<SwFont> pFntL )
57 : SwNumberPortion( rExpand, std::move(pFntL), true, false, 0, false )
58 { SetWhichPor( PortionType::FootnoteNum ); }
61 /**
62 * Used in footnotes if they break across pages, master has this portion at the end.
64 * Created only in case Tools -> Footnotes and Endnotes sets the End of footnote to a non-empty
65 * value.
67 class SwQuoVadisPortion : public SwFieldPortion
69 OUString m_aErgo;
70 public:
71 SwQuoVadisPortion( const OUString &rExp, OUString aStr );
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;
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; }
80 // Field cloner for SplitGlue
81 virtual SwFieldPortion *Clone( const OUString &rExpand ) const override;
83 // Accessibility: pass information about this portion to the PortionHandler
84 virtual void HandlePortion( SwPortionHandler& rPH ) const override;
87 /**
88 * Used in footnotes if they break across pages, follow starts with this portion.
90 * Created only in case Tools -> Footnotes and Endnotes sets the Start of next page to a non-empty
91 * value.
93 class SwErgoSumPortion : public SwFieldPortion
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;
100 // Field cloner for SplitGlue
101 virtual SwFieldPortion *Clone( const OUString &rExpand ) const override;
104 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */