xref: /trunk/main/sw/inc/ftninfo.hxx (revision 1ecadb572e7010ff3b3382ad9bf179dbc6efadbb)
1 /*************************************************************************
2  *
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * Copyright 2000, 2010 Oracle and/or its affiliates.
6  *
7  * OpenOffice.org - a multi-platform office productivity suite
8  *
9  * This file is part of OpenOffice.org.
10  *
11  * OpenOffice.org is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU Lesser General Public License version 3
13  * only, as published by the Free Software Foundation.
14  *
15  * OpenOffice.org is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU Lesser General Public License version 3 for more details
19  * (a copy is included in the LICENSE file that accompanied this code).
20  *
21  * You should have received a copy of the GNU Lesser General Public License
22  * version 3 along with OpenOffice.org.  If not, see
23  * <http://www.openoffice.org/license.html>
24  * for a copy of the LGPLv3 License.
25  *
26  ************************************************************************/
27 #ifndef _FTNINFO_HXX
28 #define _FTNINFO_HXX
29 
30 #include <tools/string.hxx>
31 #include "swdllapi.h"
32 #include <calbck.hxx>
33 #include <editeng/numitem.hxx>
34 
35 class SwTxtFmtColl;
36 class SwPageDesc;
37 class SwCharFmt;
38 class SwDoc;
39 
40 class SW_DLLPUBLIC SwEndNoteInfo : public SwClient
41 {
42     SwDepend    aPageDescDep;
43     SwDepend    aCharFmtDep, aAnchorCharFmtDep;
44     String      sPrefix;
45     String      sSuffix;
46 protected:
47     bool        m_bEndNote;
48    virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew );
49 
50 public:
51     SvxNumberType aFmt;
52     sal_uInt16    nFtnOffset;
53 
54     void        ChgPageDesc( SwPageDesc *pDesc );
55     SwPageDesc* GetPageDesc( SwDoc &rDoc ) const;
56     bool        KnowsPageDesc() const;
57     bool        DependsOn( const SwPageDesc* ) const;
58 
59     void SetFtnTxtColl(SwTxtFmtColl& rColl);
60     SwTxtFmtColl* GetFtnTxtColl() const { return  (SwTxtFmtColl*) GetRegisteredIn(); } // kann 0 sein
61 
62     SwCharFmt* GetCharFmt(SwDoc &rDoc) const;
63     void SetCharFmt( SwCharFmt* );
64     SwClient   *GetCharFmtDep() const { return (SwClient*)&aCharFmtDep; }
65 
66     SwCharFmt* GetAnchorCharFmt(SwDoc &rDoc) const;
67     void SetAnchorCharFmt( SwCharFmt* );
68     SwClient   *GetAnchorCharFmtDep() const { return (SwClient*)&aAnchorCharFmtDep; }
69 
70     SwEndNoteInfo & operator=(const SwEndNoteInfo&);
71     sal_Bool operator==( const SwEndNoteInfo &rInf ) const;
72 
73     SwEndNoteInfo( SwTxtFmtColl *pTxtColl = 0);
74     SwEndNoteInfo(const SwEndNoteInfo&);
75 
76     const String& GetPrefix() const         { return sPrefix; }
77     const String& GetSuffix() const         { return sSuffix; }
78 
79     void SetPrefix(const String& rSet)      { sPrefix = rSet; }
80     void SetSuffix(const String& rSet)      { sSuffix = rSet; }
81     void ReleaseCollection() { if ( GetRegisteredInNonConst() ) GetRegisteredInNonConst()->Remove( this ); }
82 };
83 
84 enum SwFtnPos
85 {
86     //Derzeit nur PAGE und CHAPTER. CHAPTER == Dokumentendenoten.
87     FTNPOS_PAGE = 1,
88     FTNPOS_CHAPTER = 8
89 };
90 
91 enum SwFtnNum
92 {
93     FTNNUM_PAGE, FTNNUM_CHAPTER, FTNNUM_DOC
94 };
95 
96 class SW_DLLPUBLIC SwFtnInfo: public SwEndNoteInfo
97 {
98     using SwEndNoteInfo::operator ==;
99 
100 public:
101     String    aQuoVadis;
102     String    aErgoSum;
103     SwFtnPos  ePos;
104     SwFtnNum  eNum;
105 
106 
107     SwFtnInfo& operator=(const SwFtnInfo&);
108 
109     sal_Bool operator==( const SwFtnInfo &rInf ) const;
110 
111     SwFtnInfo(SwTxtFmtColl* pTxtColl = 0);
112     SwFtnInfo(const SwFtnInfo&);
113 };
114 
115 
116 #endif
117