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
45 : public SfxPoolItem
46 , public sw::BroadcastingModify
47{
48 friend class SwTextFootnote;
50 OUString m_aNumber;
51 sal_uInt16 m_nNumber;
52 sal_uInt16 m_nNumberRLHidden;
54
56
57 SwFormatFootnote& operator=(const SwFormatFootnote& rFootnote) = delete;
59
60public:
61 SwFormatFootnote( bool bEndNote = false );
62 virtual ~SwFormatFootnote() override;
63
65 virtual bool operator==( const SfxPoolItem& ) const override;
66 virtual SwFormatFootnote* Clone( SfxItemPool* pPool = nullptr ) const override;
67
68 virtual void SwClientNotify(const SwModify&, const SfxHint&) override;
69
70 void InvalidateFootnote();
71
72 const OUString& GetNumStr() const { return m_aNumber; }
73 sal_uInt16 GetNumber() const { return m_nNumber; }
74 sal_uInt16 GetNumberRLHidden() const { return m_nNumberRLHidden; }
75 bool IsEndNote() const { return m_bEndNote;}
76
77 void SetNumStr( const OUString& rStr ) { m_aNumber = rStr; }
78 void SetEndNote( bool b );
79
80 void SetNumber( const SwFormatFootnote& rFootnote )
81 {
82 m_nNumber = rFootnote.m_nNumber;
83 m_nNumberRLHidden = rFootnote.m_nNumberRLHidden;
84 m_aNumber = rFootnote.m_aNumber;
85 }
86
87 const SwTextFootnote *GetTextFootnote() const { return m_pTextAttr; }
88 SwTextFootnote *GetTextFootnote() { return m_pTextAttr; }
89
90 OUString GetFootnoteText(SwRootFrame const& rLayout) const;
91
93 OUString GetViewNumStr(const SwDoc& rDoc, SwRootFrame const* pLayout,
94 bool bInclStrings = false) const;
95
96 css::uno::Reference<css::text::XTextRange> getAnchor(SwDoc& rDoc) const;
97
99 { return m_wXFootnote; }
100 void SetXFootnote(rtl::Reference<SwXFootnote> const& xNote);
101
102 void dumpAsXml(xmlTextWriterPtr pWriter) const override;
103};
104
105#endif
106
107/* 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
SfxPoolItem subclass for footnotes and endnotes, stored in the anchor text node.
Definition: fmtftn.hxx:47
SwFormatFootnote & operator=(const SwFormatFootnote &rFootnote)=delete
OUString m_aNumber
User-defined 'Number'.
Definition: fmtftn.hxx:50
SwTextFootnote * m_pTextAttr
My TextAttribute.
Definition: fmtftn.hxx:49
sal_uInt16 GetNumber() const
Definition: fmtftn.hxx:73
sal_uInt16 m_nNumber
automatic sequence number
Definition: fmtftn.hxx:51
sal_uInt16 m_nNumberRLHidden
automatic sequence number (hidden redlines)
Definition: fmtftn.hxx:52
const OUString & GetNumStr() const
Definition: fmtftn.hxx:72
SwTextFootnote * GetTextFootnote()
Definition: fmtftn.hxx:88
sal_uInt16 GetNumberRLHidden() const
Definition: fmtftn.hxx:74
bool IsEndNote() const
Definition: fmtftn.hxx:75
unotools::WeakReference< SwXFootnote > const & GetXFootnote() const
Definition: fmtftn.hxx:98
void SetNumStr(const OUString &rStr)
Definition: fmtftn.hxx:77
const SwTextFootnote * GetTextFootnote() const
Definition: fmtftn.hxx:87
SwFormatFootnote(const SwFormatFootnote &)=delete
bool m_bEndNote
Is it an End note?
Definition: fmtftn.hxx:53
void SetNumber(const SwFormatFootnote &rFootnote)
Definition: fmtftn.hxx:80
unotools::WeakReference< SwXFootnote > m_wXFootnote
Definition: fmtftn.hxx:55
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