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_FMTFTN_HXX
20 #define INCLUDED_SW_INC_FMTFTN_HXX
22 #include <rtl/ustring.hxx>
23 #include <cppuhelper/weakref.hxx>
24 #include <svl/poolitem.hxx>
29 namespace com
{ namespace sun
{ namespace star
{
30 namespace text
{ class XFootnote
; }
38 class SW_DLLPUBLIC SwFormatFootnote
42 friend class SwTextFootnote
;
43 SwTextFootnote
* m_pTextAttr
; ///< My TextAttribute.
44 OUString m_aNumber
; ///< User-defined 'Number'.
45 sal_uInt16 m_nNumber
; ///< Automatische Nummerierung
46 bool m_bEndNote
; ///< Is it an End note?
48 css::uno::WeakReference
<css::text::XFootnote
> m_wXFootnote
;
50 SwFormatFootnote
& operator=(const SwFormatFootnote
& rFootnote
) SAL_DELETED_FUNCTION
;
51 SwFormatFootnote( const SwFormatFootnote
& ) SAL_DELETED_FUNCTION
;
54 SwFormatFootnote( bool bEndNote
= false );
55 virtual ~SwFormatFootnote();
57 /// "Pure virtual methods" of SfxPoolItem.
58 virtual bool operator==( const SfxPoolItem
& ) const SAL_OVERRIDE
;
59 virtual SfxPoolItem
* Clone( SfxItemPool
* pPool
= 0 ) const SAL_OVERRIDE
;
62 virtual void Modify(SfxPoolItem
const* pOld
, SfxPoolItem
const* pNew
)
65 void InvalidateFootnote();
67 OUString
GetNumStr() const { return m_aNumber
; }
68 sal_uInt16
GetNumber() const { return m_nNumber
; }
69 bool IsEndNote() const { return m_bEndNote
;}
71 void SetNumStr( const OUString
& rStr
) { m_aNumber
= rStr
; }
72 void SetNumber( sal_uInt16 nNo
) { m_nNumber
= nNo
; }
73 void SetEndNote( bool b
);
75 void SetNumber( const SwFormatFootnote
& rFootnote
)
77 m_nNumber
= rFootnote
.m_nNumber
;
78 m_aNumber
= rFootnote
.m_aNumber
;
81 const SwTextFootnote
*GetTextFootnote() const { return m_pTextAttr
; }
82 SwTextFootnote
*GetTextFootnote() { return m_pTextAttr
; }
84 void GetFootnoteText( OUString
& rStr
) const;
86 /// Returns string to be displayed of footnote / endnote.
87 OUString
GetViewNumStr( const SwDoc
& rDoc
, bool bInclStrs
= false ) const;
89 css::uno::WeakReference
<css::text::XFootnote
> const& GetXFootnote() const
90 { return m_wXFootnote
; }
91 void SetXFootnote(css::uno::Reference
<css::text::XFootnote
> const& xNote
)
92 { m_wXFootnote
= xNote
; }
97 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */