Resolves tdf#142513 - Order of ZoomIn and ZoomOut at Print Preview
[LibreOffice.git] / sw / inc / fmtftntx.hxx
blobc3783178b714b2805a9344330bf26e9716e98656
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 .
19 #ifndef INCLUDED_SW_INC_FMTFTNTX_HXX
20 #define INCLUDED_SW_INC_FMTFTNTX_HXX
22 #include <svl/eitem.hxx>
23 #include <editeng/numitem.hxx>
24 #include "hintids.hxx"
25 #include "format.hxx"
26 #include "swdllapi.h"
28 enum SwFootnoteEndPosEnum
30 FTNEND_ATPGORDOCEND, ///< at page or document end
31 FTNEND_ATTXTEND, ///< at end of the current text end
32 FTNEND_ATTXTEND_OWNNUMSEQ, ///< -""- and with own number sequence
33 FTNEND_ATTXTEND_OWNNUMANDFMT, ///< -""- and with own numberformat
34 FTNEND_ATTXTEND_END
37 class SW_DLLPUBLIC SwFormatFootnoteEndAtTextEnd : public SfxEnumItem<SwFootnoteEndPosEnum>
39 OUString m_sPrefix;
40 OUString m_sSuffix;
41 SvxNumberType m_aFormat;
42 sal_uInt16 m_nOffset;
44 protected:
45 SwFormatFootnoteEndAtTextEnd( sal_uInt16 nWhichL, SwFootnoteEndPosEnum ePos )
46 : SfxEnumItem( nWhichL, ePos ), m_nOffset( 0 )
49 public:
50 virtual sal_uInt16 GetValueCount() const override;
52 virtual bool operator==( const SfxPoolItem& ) const override;
54 virtual bool QueryValue( css::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const override;
55 virtual bool PutValue( const css::uno::Any& rVal, sal_uInt8 nMemberId ) override;
57 virtual bool GetPresentation( SfxItemPresentation ePres,
58 MapUnit eCoreMetric,
59 MapUnit ePresMetric,
60 OUString &rText,
61 const IntlWrapper& rIntl ) const override;
63 bool IsAtEnd() const { return FTNEND_ATPGORDOCEND != GetValue(); }
65 SwFormatFootnoteEndAtTextEnd & operator=( const SwFormatFootnoteEndAtTextEnd & rAttr );
66 SwFormatFootnoteEndAtTextEnd(SwFormatFootnoteEndAtTextEnd const &) = default;
67 // SfxPoolItem copy function dichotomy
69 SvxNumType GetNumType() const { return m_aFormat.GetNumberingType(); }
70 void SetNumType( SvxNumType eType ) { m_aFormat.SetNumberingType(eType); }
72 const SvxNumberType& GetSwNumType() const { return m_aFormat; }
74 sal_uInt16 GetOffset() const { return m_nOffset; }
75 void SetOffset( sal_uInt16 nOff ) { m_nOffset = nOff; }
77 const OUString& GetPrefix() const { return m_sPrefix; }
78 void SetPrefix(const OUString& rSet) { m_sPrefix = rSet; }
80 const OUString& GetSuffix() const { return m_sSuffix; }
81 void SetSuffix(const OUString& rSet) { m_sSuffix = rSet; }
84 class SW_DLLPUBLIC SwFormatFootnoteAtTextEnd : public SwFormatFootnoteEndAtTextEnd
86 public:
87 SwFormatFootnoteAtTextEnd( SwFootnoteEndPosEnum ePos = FTNEND_ATPGORDOCEND )
88 : SwFormatFootnoteEndAtTextEnd( RES_FTN_AT_TXTEND, ePos )
91 virtual SwFormatFootnoteAtTextEnd* Clone( SfxItemPool *pPool = nullptr ) const override;
94 class SW_DLLPUBLIC SwFormatEndAtTextEnd : public SwFormatFootnoteEndAtTextEnd
96 public:
97 SwFormatEndAtTextEnd( SwFootnoteEndPosEnum ePos = FTNEND_ATPGORDOCEND )
98 : SwFormatFootnoteEndAtTextEnd( RES_END_AT_TXTEND, ePos )
100 SetNumType( SVX_NUM_ROMAN_LOWER );
103 virtual SwFormatEndAtTextEnd* Clone( SfxItemPool *pPool = nullptr ) const override;
106 inline const SwFormatFootnoteAtTextEnd &SwAttrSet::GetFootnoteAtTextEnd(bool bInP) const
107 { return Get( RES_FTN_AT_TXTEND, bInP); }
108 inline const SwFormatEndAtTextEnd &SwAttrSet::GetEndAtTextEnd(bool bInP) const
109 { return Get( RES_END_AT_TXTEND, bInP); }
111 inline const SwFormatFootnoteAtTextEnd &SwFormat::GetFootnoteAtTextEnd(bool bInP) const
112 { return m_aSet.GetFootnoteAtTextEnd(bInP); }
113 inline const SwFormatEndAtTextEnd &SwFormat::GetEndAtTextEnd(bool bInP) const
114 { return m_aSet.GetEndAtTextEnd(bInP); }
116 #endif
118 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */