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 <svl/poolitem.hxx>
24 : #include "swdllapi.h"
25 :
26 : class SwDoc;
27 : class SwTxtFtn;
28 :
29 : // ATT_FTN
30 :
31 : class SW_DLLPUBLIC SwFmtFtn: public SfxPoolItem
32 : {
33 : friend class SwTxtFtn;
34 : SwTxtFtn* m_pTxtAttr; ///< My TextAttribute.
35 : OUString m_aNumber; ///< User-defined 'Number'.
36 : sal_uInt16 m_nNumber; ///< Automatische Nummerierung
37 : bool m_bEndNote; ///< Is it an End note?
38 :
39 : /// Protected CopyCtor.
40 : SwFmtFtn& operator=(const SwFmtFtn& rFtn);
41 : SwFmtFtn( const SwFmtFtn& );
42 :
43 : public:
44 : SwFmtFtn( bool bEndNote = false );
45 : virtual ~SwFmtFtn();
46 :
47 : /// "Pure virtual methods" of SfxPoolItem.
48 : virtual bool operator==( const SfxPoolItem& ) const SAL_OVERRIDE;
49 : virtual SfxPoolItem* Clone( SfxItemPool* pPool = 0 ) const SAL_OVERRIDE;
50 :
51 0 : OUString GetNumStr() const { return m_aNumber; }
52 0 : sal_uInt16 GetNumber() const { return m_nNumber; }
53 0 : bool IsEndNote() const { return m_bEndNote;}
54 :
55 0 : void SetNumStr( const OUString& rStr ) { m_aNumber = rStr; }
56 : void SetNumber( sal_uInt16 nNo ) { m_nNumber = nNo; }
57 : void SetEndNote( bool b );
58 :
59 0 : void SetNumber( const SwFmtFtn& rFtn )
60 : {
61 0 : m_nNumber = rFtn.m_nNumber;
62 0 : m_aNumber = rFtn.m_aNumber;
63 0 : }
64 :
65 0 : const SwTxtFtn *GetTxtFtn() const { return m_pTxtAttr; }
66 0 : SwTxtFtn *GetTxtFtn() { return m_pTxtAttr; }
67 :
68 : void GetFtnText( OUString& rStr ) const;
69 :
70 : /// Returns string to be displayed of footnote / endnote.
71 : OUString GetViewNumStr( const SwDoc& rDoc, sal_Bool bInclStrs = sal_False ) const;
72 : };
73 :
74 : #endif
75 :
76 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|