Line data Source code
1 : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : /*
3 : * This file is part of the LibreOffice project.
4 : *
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/.
8 : *
9 : * This file incorporates work covered by the following license notice:
10 : *
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 .
18 : */
19 : #ifndef INCLUDED_SW_INC_FMTFTN_HXX
20 : #define INCLUDED_SW_INC_FMTFTN_HXX
21 :
22 : #include <rtl/ustring.hxx>
23 : #include <cppuhelper/weakref.hxx>
24 : #include <svl/poolitem.hxx>
25 :
26 : #include "swdllapi.h"
27 : #include <calbck.hxx>
28 :
29 : namespace com { namespace sun { namespace star {
30 : namespace text { class XFootnote; }
31 : } } }
32 :
33 : class SwDoc;
34 : class SwTextFootnote;
35 :
36 : // ATT_FTN
37 :
38 : class SW_DLLPUBLIC SwFormatFootnote
39 : : public SfxPoolItem
40 : , public SwModify
41 : {
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?
47 :
48 : css::uno::WeakReference<css::text::XFootnote> m_wXFootnote;
49 :
50 : SwFormatFootnote& operator=(const SwFormatFootnote& rFootnote) SAL_DELETED_FUNCTION;
51 : SwFormatFootnote( const SwFormatFootnote& ) SAL_DELETED_FUNCTION;
52 :
53 : public:
54 : SwFormatFootnote( bool bEndNote = false );
55 : virtual ~SwFormatFootnote();
56 :
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;
60 :
61 : // SwClient
62 : virtual void Modify(SfxPoolItem const* pOld, SfxPoolItem const* pNew)
63 : SAL_OVERRIDE;
64 :
65 : void InvalidateFootnote();
66 :
67 1008 : OUString GetNumStr() const { return m_aNumber; }
68 485 : sal_uInt16 GetNumber() const { return m_nNumber; }
69 4528 : bool IsEndNote() const { return m_bEndNote;}
70 :
71 35 : void SetNumStr( const OUString& rStr ) { m_aNumber = rStr; }
72 : void SetNumber( sal_uInt16 nNo ) { m_nNumber = nNo; }
73 : void SetEndNote( bool b );
74 :
75 0 : void SetNumber( const SwFormatFootnote& rFootnote )
76 : {
77 0 : m_nNumber = rFootnote.m_nNumber;
78 0 : m_aNumber = rFootnote.m_aNumber;
79 0 : }
80 :
81 1100 : const SwTextFootnote *GetTextFootnote() const { return m_pTextAttr; }
82 138 : SwTextFootnote *GetTextFootnote() { return m_pTextAttr; }
83 :
84 : void GetFootnoteText( OUString& rStr ) const;
85 :
86 : /// Returns string to be displayed of footnote / endnote.
87 : OUString GetViewNumStr( const SwDoc& rDoc, bool bInclStrs = false ) const;
88 :
89 36 : css::uno::WeakReference<css::text::XFootnote> const& GetXFootnote() const
90 36 : { return m_wXFootnote; }
91 34 : void SetXFootnote(css::uno::Reference<css::text::XFootnote> const& xNote)
92 34 : { m_wXFootnote = xNote; }
93 : };
94 :
95 : #endif
96 :
97 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|