1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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"
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
37 class SW_DLLPUBLIC SwFormatFootnoteEndAtTextEnd
: public SfxEnumItem
<SwFootnoteEndPosEnum
>
41 SvxNumberType m_aFormat
;
45 SwFormatFootnoteEndAtTextEnd( sal_uInt16 nWhichL
, SwFootnoteEndPosEnum ePos
)
46 : SfxEnumItem( nWhichL
, ePos
), m_nOffset( 0 )
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
,
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
87 SwFormatFootnoteAtTextEnd( SwFootnoteEndPosEnum ePos
= FTNEND_ATPGORDOCEND
)
88 : SwFormatFootnoteEndAtTextEnd( RES_FTN_AT_TXTEND
, ePos
)
91 virtual SfxPoolItem
* Clone( SfxItemPool
*pPool
= nullptr ) const override
;
94 class SW_DLLPUBLIC SwFormatEndAtTextEnd
: public SwFormatFootnoteEndAtTextEnd
97 SwFormatEndAtTextEnd( SwFootnoteEndPosEnum ePos
= FTNEND_ATPGORDOCEND
)
98 : SwFormatFootnoteEndAtTextEnd( RES_END_AT_TXTEND
, ePos
)
100 SetNumType( SVX_NUM_ROMAN_LOWER
);
103 virtual SfxPoolItem
* 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
); }
118 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */