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>
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 { namespace text {
30  class XFootnote;
31  class XTextRange;
32 } } } }
33 
34 class SwDoc;
35 class SwTextFootnote;
36 class SwRootFrame;
37 
38 // ATT_FTN
39 
41  : public SfxPoolItem
42  , public SwModify
43  , public sw::BroadcasterMixin
44 {
45  friend class SwTextFootnote;
47  OUString m_aNumber;
48  sal_uInt16 m_nNumber;
49  sal_uInt16 m_nNumberRLHidden;
50  bool m_bEndNote;
51 
52  css::uno::WeakReference<css::text::XFootnote> m_wXFootnote;
53 
54  SwFormatFootnote& operator=(const SwFormatFootnote& rFootnote) = delete;
55  SwFormatFootnote( const SwFormatFootnote& ) = delete;
56 
57 public:
58  SwFormatFootnote( bool bEndNote = false );
59  virtual ~SwFormatFootnote() override;
60 
62  virtual bool operator==( const SfxPoolItem& ) const override;
63  virtual SfxPoolItem* Clone( SfxItemPool* pPool = nullptr ) const override;
64 
65  // SwClient
66  virtual void Modify(SfxPoolItem const* pOld, SfxPoolItem const* pNew)
67  override;
68 
69  void InvalidateFootnote();
70 
71  const OUString& GetNumStr() const { return m_aNumber; }
72  sal_uInt16 GetNumber() const { return m_nNumber; }
73  sal_uInt16 GetNumberRLHidden() const { return m_nNumberRLHidden; }
74  bool IsEndNote() const { return m_bEndNote;}
75 
76  void SetNumStr( const OUString& rStr ) { m_aNumber = rStr; }
77  void SetEndNote( bool b );
78 
79  void SetNumber( const SwFormatFootnote& rFootnote )
80  {
81  m_nNumber = rFootnote.m_nNumber;
82  m_nNumberRLHidden = rFootnote.m_nNumberRLHidden;
83  m_aNumber = rFootnote.m_aNumber;
84  }
85 
86  const SwTextFootnote *GetTextFootnote() const { return m_pTextAttr; }
87  SwTextFootnote *GetTextFootnote() { return m_pTextAttr; }
88 
89  OUString GetFootnoteText(SwRootFrame const& rLayout) const;
90 
92  OUString GetViewNumStr(const SwDoc& rDoc, SwRootFrame const* pLayout,
93  bool bInclStrings = false) const;
94 
95  css::uno::Reference<css::text::XTextRange> getAnchor(SwDoc& rDoc) const;
96 
97  css::uno::WeakReference<css::text::XFootnote> const& GetXFootnote() const
98  { return m_wXFootnote; }
99  void SetXFootnote(css::uno::Reference<css::text::XFootnote> const& xNote)
100  { m_wXFootnote = xNote; }
101 };
102 
103 #endif
104 
105 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual bool operator==(const SfxPoolItem &) const =0
void SetXFootnote(css::uno::Reference< css::text::XFootnote > const &xNote)
Definition: fmtftn.hxx:99
virtual SfxPoolItem * Clone(SfxItemPool *pPool=nullptr) const =0
Definition: doc.hxx:185
void SetNumStr(const OUString &rStr)
Definition: fmtftn.hxx:76
SfxPoolItem & operator=(const SfxPoolItem &)=delete
SwTextFootnote * m_pTextAttr
My TextAttribute.
Definition: fmtftn.hxx:46
bool IsEndNote() const
Definition: fmtftn.hxx:74
SwTextFootnote * GetTextFootnote()
Definition: fmtftn.hxx:87
The root element of a Writer document layout.
Definition: rootfrm.hxx:79
const SwTextFootnote * GetTextFootnote() const
Definition: fmtftn.hxx:86
const OUString & GetNumStr() const
Definition: fmtftn.hxx:71
sal_uInt16 m_nNumber
automatic sequence number
Definition: fmtftn.hxx:48
OUString m_aNumber
User-defined 'Number'.
Definition: fmtftn.hxx:47
sal_uInt16 GetNumberRLHidden() const
Definition: fmtftn.hxx:73
#define SW_DLLPUBLIC
Definition: swdllapi.h:28
virtual void Modify(const SfxPoolItem *pOld, const SfxPoolItem *pNew) override
Definition: calbck.hxx:183
sal_uInt16 m_nNumberRLHidden
automatic sequence number (hidden redlines)
Definition: fmtftn.hxx:49
css::uno::WeakReference< css::text::XFootnote > m_wXFootnote
Definition: fmtftn.hxx:52
bool m_bEndNote
Is it an End note?
Definition: fmtftn.hxx:50
css::uno::WeakReference< css::text::XFootnote > const & GetXFootnote() const
Definition: fmtftn.hxx:97
void SetNumber(const SwFormatFootnote &rFootnote)
Definition: fmtftn.hxx:79
def text(shape, st)
sal_uInt16 GetNumber() const
Definition: fmtftn.hxx:72