xref: /AOO41X/main/sw/inc/ftninfo.hxx (revision 1d2dbeb0b7301723c6d13094e87a8714ef81a328)
1*1d2dbeb0SAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*1d2dbeb0SAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*1d2dbeb0SAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*1d2dbeb0SAndrew Rist  * distributed with this work for additional information
6*1d2dbeb0SAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*1d2dbeb0SAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*1d2dbeb0SAndrew Rist  * "License"); you may not use this file except in compliance
9*1d2dbeb0SAndrew Rist  * with the License.  You may obtain a copy of the License at
10cdf0e10cSrcweir  *
11*1d2dbeb0SAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12cdf0e10cSrcweir  *
13*1d2dbeb0SAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*1d2dbeb0SAndrew Rist  * software distributed under the License is distributed on an
15*1d2dbeb0SAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*1d2dbeb0SAndrew Rist  * KIND, either express or implied.  See the License for the
17*1d2dbeb0SAndrew Rist  * specific language governing permissions and limitations
18*1d2dbeb0SAndrew Rist  * under the License.
19cdf0e10cSrcweir  *
20*1d2dbeb0SAndrew Rist  *************************************************************/
21*1d2dbeb0SAndrew Rist 
22*1d2dbeb0SAndrew Rist 
23cdf0e10cSrcweir #ifndef _FTNINFO_HXX
24cdf0e10cSrcweir #define _FTNINFO_HXX
25cdf0e10cSrcweir 
26cdf0e10cSrcweir #include <tools/string.hxx>
27cdf0e10cSrcweir #include "swdllapi.h"
28cdf0e10cSrcweir #include <calbck.hxx>
29cdf0e10cSrcweir #include <editeng/numitem.hxx>
30cdf0e10cSrcweir 
31cdf0e10cSrcweir class SwTxtFmtColl;
32cdf0e10cSrcweir class SwPageDesc;
33cdf0e10cSrcweir class SwCharFmt;
34cdf0e10cSrcweir class SwDoc;
35cdf0e10cSrcweir 
36cdf0e10cSrcweir class SW_DLLPUBLIC SwEndNoteInfo : public SwClient
37cdf0e10cSrcweir {
38cdf0e10cSrcweir 	SwDepend  	aPageDescDep;
39cdf0e10cSrcweir 	SwDepend 	aCharFmtDep, aAnchorCharFmtDep;
40cdf0e10cSrcweir 	String 		sPrefix;
41cdf0e10cSrcweir 	String 		sSuffix;
42cdf0e10cSrcweir protected:
43cdf0e10cSrcweir     bool        m_bEndNote;
44cdf0e10cSrcweir    virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew );
45cdf0e10cSrcweir 
46cdf0e10cSrcweir public:
47cdf0e10cSrcweir 	SvxNumberType aFmt;
48cdf0e10cSrcweir 	sal_uInt16 	  nFtnOffset;
49cdf0e10cSrcweir 
50cdf0e10cSrcweir 	void 		ChgPageDesc( SwPageDesc *pDesc );
51cdf0e10cSrcweir 	SwPageDesc* GetPageDesc( SwDoc &rDoc ) const;
52cdf0e10cSrcweir     bool        KnowsPageDesc() const;
53cdf0e10cSrcweir     bool        DependsOn( const SwPageDesc* ) const;
54cdf0e10cSrcweir 
55cdf0e10cSrcweir 	void SetFtnTxtColl(SwTxtFmtColl& rColl);
GetFtnTxtColl() const56cdf0e10cSrcweir 	SwTxtFmtColl* GetFtnTxtColl() const { return  (SwTxtFmtColl*) GetRegisteredIn(); } // kann 0 sein
57cdf0e10cSrcweir 
58cdf0e10cSrcweir 	SwCharFmt* GetCharFmt(SwDoc &rDoc) const;
59cdf0e10cSrcweir 	void SetCharFmt( SwCharFmt* );
GetCharFmtDep() const60cdf0e10cSrcweir 	SwClient   *GetCharFmtDep() const { return (SwClient*)&aCharFmtDep; }
61cdf0e10cSrcweir 
62cdf0e10cSrcweir 	SwCharFmt* GetAnchorCharFmt(SwDoc &rDoc) const;
63cdf0e10cSrcweir 	void SetAnchorCharFmt( SwCharFmt* );
GetAnchorCharFmtDep() const64cdf0e10cSrcweir 	SwClient   *GetAnchorCharFmtDep() const { return (SwClient*)&aAnchorCharFmtDep; }
65cdf0e10cSrcweir 
66cdf0e10cSrcweir 	SwEndNoteInfo & operator=(const SwEndNoteInfo&);
67cdf0e10cSrcweir 	sal_Bool operator==( const SwEndNoteInfo &rInf ) const;
68cdf0e10cSrcweir 
69cdf0e10cSrcweir 	SwEndNoteInfo( SwTxtFmtColl *pTxtColl = 0);
70cdf0e10cSrcweir 	SwEndNoteInfo(const SwEndNoteInfo&);
71cdf0e10cSrcweir 
GetPrefix() const72cdf0e10cSrcweir 	const String& GetPrefix() const 		{ return sPrefix; }
GetSuffix() const73cdf0e10cSrcweir 	const String& GetSuffix() const 		{ return sSuffix; }
74cdf0e10cSrcweir 
SetPrefix(const String & rSet)75cdf0e10cSrcweir 	void SetPrefix(const String& rSet)		{ sPrefix = rSet; }
SetSuffix(const String & rSet)76cdf0e10cSrcweir 	void SetSuffix(const String& rSet)		{ sSuffix = rSet; }
ReleaseCollection()77cdf0e10cSrcweir     void ReleaseCollection() { if ( GetRegisteredInNonConst() ) GetRegisteredInNonConst()->Remove( this ); }
78cdf0e10cSrcweir };
79cdf0e10cSrcweir 
80cdf0e10cSrcweir enum SwFtnPos
81cdf0e10cSrcweir {
82cdf0e10cSrcweir 	//Derzeit nur PAGE und CHAPTER. CHAPTER == Dokumentendenoten.
83cdf0e10cSrcweir 	FTNPOS_PAGE = 1,
84cdf0e10cSrcweir 	FTNPOS_CHAPTER = 8
85cdf0e10cSrcweir };
86cdf0e10cSrcweir 
87cdf0e10cSrcweir enum SwFtnNum
88cdf0e10cSrcweir {
89cdf0e10cSrcweir 	FTNNUM_PAGE, FTNNUM_CHAPTER, FTNNUM_DOC
90cdf0e10cSrcweir };
91cdf0e10cSrcweir 
92cdf0e10cSrcweir class SW_DLLPUBLIC SwFtnInfo: public SwEndNoteInfo
93cdf0e10cSrcweir {
94cdf0e10cSrcweir     using SwEndNoteInfo::operator ==;
95cdf0e10cSrcweir 
96cdf0e10cSrcweir public:
97cdf0e10cSrcweir 	String    aQuoVadis;
98cdf0e10cSrcweir 	String	  aErgoSum;
99cdf0e10cSrcweir 	SwFtnPos  ePos;
100cdf0e10cSrcweir 	SwFtnNum  eNum;
101cdf0e10cSrcweir 
102cdf0e10cSrcweir 
103cdf0e10cSrcweir 	SwFtnInfo& operator=(const SwFtnInfo&);
104cdf0e10cSrcweir 
105cdf0e10cSrcweir 	sal_Bool operator==( const SwFtnInfo &rInf ) const;
106cdf0e10cSrcweir 
107cdf0e10cSrcweir 	SwFtnInfo(SwTxtFmtColl* pTxtColl = 0);
108cdf0e10cSrcweir 	SwFtnInfo(const SwFtnInfo&);
109cdf0e10cSrcweir };
110cdf0e10cSrcweir 
111cdf0e10cSrcweir 
112cdf0e10cSrcweir #endif
113