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