Branch libreoffice-5-0-4
[LibreOffice.git] / sw / inc / fmtftntx.hxx
blobcfb7c7346d4667930e722b28ceda49e4107a495c
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 <hintids.hxx>
24 #include <format.hxx>
25 #include <numrule.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
39 OUString sPrefix;
40 OUString sSuffix;
41 SvxNumberType aFormat;
42 sal_uInt16 nOffset;
44 protected:
45 SwFormatFootnoteEndAtTextEnd( sal_uInt16 nWhichL, SwFootnoteEndPosEnum ePos )
46 : SfxEnumItem( nWhichL, sal::static_int_cast< sal_uInt16 >(ePos) ), nOffset( 0 )
48 SwFormatFootnoteEndAtTextEnd( const SwFormatFootnoteEndAtTextEnd& rAttr )
49 : SfxEnumItem( rAttr ), sPrefix( rAttr.sPrefix ),
50 sSuffix( rAttr.sSuffix ), aFormat( rAttr.aFormat ),
51 nOffset( rAttr.nOffset )
54 public:
55 virtual sal_uInt16 GetValueCount() const SAL_OVERRIDE;
57 virtual bool operator==( const SfxPoolItem& ) const SAL_OVERRIDE;
59 virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const SAL_OVERRIDE;
60 virtual bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) SAL_OVERRIDE;
62 virtual bool GetPresentation( SfxItemPresentation ePres,
63 SfxMapUnit eCoreMetric,
64 SfxMapUnit ePresMetric,
65 OUString &rText,
66 const IntlWrapper* pIntl = 0 ) const SAL_OVERRIDE;
68 inline bool IsAtEnd() const { return FTNEND_ATPGORDOCEND != GetValue(); }
70 SwFormatFootnoteEndAtTextEnd & operator=( const SwFormatFootnoteEndAtTextEnd & rAttr );
72 sal_Int16 GetNumType() const { return aFormat.GetNumberingType(); }
73 void SetNumType( sal_Int16 eType ) { aFormat.SetNumberingType(eType); }
75 const SvxNumberType& GetSwNumType() const { return aFormat; }
77 sal_uInt16 GetOffset() const { return nOffset; }
78 void SetOffset( sal_uInt16 nOff ) { nOffset = nOff; }
80 const OUString& GetPrefix() const { return sPrefix; }
81 void SetPrefix(const OUString& rSet) { sPrefix = rSet; }
83 const OUString& GetSuffix() const { return sSuffix; }
84 void SetSuffix(const OUString& rSet) { sSuffix = rSet; }
87 class SW_DLLPUBLIC SwFormatFootnoteAtTextEnd : public SwFormatFootnoteEndAtTextEnd
89 public:
90 SwFormatFootnoteAtTextEnd( SwFootnoteEndPosEnum ePos = FTNEND_ATPGORDOCEND )
91 : SwFormatFootnoteEndAtTextEnd( RES_FTN_AT_TXTEND, ePos )
94 virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const SAL_OVERRIDE;
97 class SW_DLLPUBLIC SwFormatEndAtTextEnd : public SwFormatFootnoteEndAtTextEnd
99 public:
100 SwFormatEndAtTextEnd( SwFootnoteEndPosEnum ePos = FTNEND_ATPGORDOCEND )
101 : SwFormatFootnoteEndAtTextEnd( RES_END_AT_TXTEND, ePos )
103 SetNumType( SVX_NUM_ROMAN_LOWER );
106 virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const SAL_OVERRIDE;
109 inline const SwFormatFootnoteAtTextEnd &SwAttrSet::GetFootnoteAtTextEnd(bool bInP) const
110 { return static_cast<const SwFormatFootnoteAtTextEnd&>(Get( RES_FTN_AT_TXTEND, bInP)); }
111 inline const SwFormatEndAtTextEnd &SwAttrSet::GetEndAtTextEnd(bool bInP) const
112 { return static_cast<const SwFormatEndAtTextEnd&>(Get( RES_END_AT_TXTEND, bInP)); }
114 inline const SwFormatFootnoteAtTextEnd &SwFormat::GetFootnoteAtTextEnd(bool bInP) const
115 { return m_aSet.GetFootnoteAtTextEnd(bInP); }
116 inline const SwFormatEndAtTextEnd &SwFormat::GetEndAtTextEnd(bool bInP) const
117 { return m_aSet.GetEndAtTextEnd(bInP); }
119 #endif
121 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */