LibreOffice Module sw (master) 1
fmtftn.hxx
Go to the documentation of this file.
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>
24#include <svl/poolitem.hxx>
25#include <unotools/weakref.hxx>
26#include <com/sun/star/text/XFootnote.hpp>
27
28#include "swdllapi.h"
29#include "calbck.hxx"
30
31namespace com::sun::star::text {
32 class XTextRange;
33}
34
35class SwDoc;
36class SwTextFootnote;
37class SwRootFrame;
38class SwXFootnote;
39
40// ATT_FTN
41
43 : public SfxPoolItem
44 , public sw::BroadcastingModify
45{
46 friend class SwTextFootnote;
48 OUString m_aNumber;
49 sal_uInt16 m_nNumber;
50 sal_uInt16 m_nNumberRLHidden;
52
54
55 SwFormatFootnote& operator=(const SwFormatFootnote& rFootnote) = delete;
57
58public:
59 SwFormatFootnote( bool bEndNote = false );
60 virtual ~SwFormatFootnote() override;
61
63 virtual bool operator==( const SfxPoolItem& ) const override;
64 virtual SwFormatFootnote* Clone( SfxItemPool* pPool = nullptr ) const override;
65
66 virtual void SwClientNotify(const SwModify&, const SfxHint&) override;
67
68 void InvalidateFootnote();
69
70 const OUString& GetNumStr() const { return m_aNumber; }
71 sal_uInt16 GetNumber() const { return m_nNumber; }
72 sal_uInt16 GetNumberRLHidden() const { return m_nNumberRLHidden; }
73 bool IsEndNote() const { return m_bEndNote;}
74
75 void SetNumStr( const OUString& rStr ) { m_aNumber = rStr; }
76 void SetEndNote( bool b );
77
78 void SetNumber( const SwFormatFootnote& rFootnote )
79 {
80 m_nNumber = rFootnote.m_nNumber;
81 m_nNumberRLHidden = rFootnote.m_nNumberRLHidden;
82 m_aNumber = rFootnote.m_aNumber;
83 }
84
85 const SwTextFootnote *GetTextFootnote() const { return m_pTextAttr; }
86 SwTextFootnote *GetTextFootnote() { return m_pTextAttr; }
87
88 OUString GetFootnoteText(SwRootFrame const& rLayout) const;
89
91 OUString GetViewNumStr(const SwDoc& rDoc, SwRootFrame const* pLayout,
92 bool bInclStrings = false) const;
93
94 css::uno::Reference<css::text::XTextRange> getAnchor(SwDoc& rDoc) const;
95
97 { return m_wXFootnote; }
98 void SetXFootnote(rtl::Reference<SwXFootnote> const& xNote);
99
100 void dumpAsXml(xmlTextWriterPtr pWriter) const override;
101};
102
103#endif
104
105/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual void dumpAsXml(xmlTextWriterPtr pWriter) const
virtual bool operator==(const SfxPoolItem &) const=0
virtual SfxPoolItem * Clone(SfxItemPool *pPool=nullptr) const=0
Definition: doc.hxx:197
SwFormatFootnote & operator=(const SwFormatFootnote &rFootnote)=delete
OUString m_aNumber
User-defined 'Number'.
Definition: fmtftn.hxx:48
SwTextFootnote * m_pTextAttr
My TextAttribute.
Definition: fmtftn.hxx:47
sal_uInt16 GetNumber() const
Definition: fmtftn.hxx:71
sal_uInt16 m_nNumber
automatic sequence number
Definition: fmtftn.hxx:49
sal_uInt16 m_nNumberRLHidden
automatic sequence number (hidden redlines)
Definition: fmtftn.hxx:50
const OUString & GetNumStr() const
Definition: fmtftn.hxx:70
SwTextFootnote * GetTextFootnote()
Definition: fmtftn.hxx:86
sal_uInt16 GetNumberRLHidden() const
Definition: fmtftn.hxx:72
bool IsEndNote() const
Definition: fmtftn.hxx:73
unotools::WeakReference< SwXFootnote > const & GetXFootnote() const
Definition: fmtftn.hxx:96
void SetNumStr(const OUString &rStr)
Definition: fmtftn.hxx:75
const SwTextFootnote * GetTextFootnote() const
Definition: fmtftn.hxx:85
SwFormatFootnote(const SwFormatFootnote &)=delete
bool m_bEndNote
Is it an End note?
Definition: fmtftn.hxx:51
void SetNumber(const SwFormatFootnote &rFootnote)
Definition: fmtftn.hxx:78
unotools::WeakReference< SwXFootnote > m_wXFootnote
Definition: fmtftn.hxx:53
The root element of a Writer document layout.
Definition: rootfrm.hxx:85
SwTextAttr subclass for footnotes and endnotes.
Definition: txtftn.hxx:34
struct _xmlTextWriter * xmlTextWriterPtr
#define SW_DLLPUBLIC
Definition: swdllapi.h:28