merge the formfield patch from ooo-build
[ooovba.git] / lotuswordpro / source / filter / lwpfootnote.hxx
blobf85bb7380d0e01a6c698c85250d3111cc098c660
1 /*************************************************************************
3 * The Contents of this file are made available subject to the terms of
4 * either of the following licenses
6 * - GNU Lesser General Public License Version 2.1
7 * - Sun Industry Standards Source License Version 1.1
9 * Sun Microsystems Inc., October, 2000
11 * GNU Lesser General Public License Version 2.1
12 * =============================================
13 * Copyright 2000 by Sun Microsystems, Inc.
14 * 901 San Antonio Road, Palo Alto, CA 94303, USA
16 * This library is free software; you can redistribute it and/or
17 * modify it under the terms of the GNU Lesser General Public
18 * License version 2.1, as published by the Free Software Foundation.
20 * This library is distributed in the hope that it will be useful,
21 * but WITHOUT ANY WARRANTY; without even the implied warranty of
22 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
23 * Lesser General Public License for more details.
25 * You should have received a copy of the GNU Lesser General Public
26 * License along with this library; if not, write to the Free Software
27 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
28 * MA 02111-1307 USA
31 * Sun Industry Standards Source License Version 1.1
32 * =================================================
33 * The contents of this file are subject to the Sun Industry Standards
34 * Source License Version 1.1 (the "License"); You may not use this file
35 * except in compliance with the License. You may obtain a copy of the
36 * License at http://www.openoffice.org/license.html.
38 * Software provided under this License is provided on an "AS IS" basis,
39 * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
40 * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
41 * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
42 * See the License for the specific provisions governing your rights and
43 * obligations concerning the Software.
45 * The Initial Developer of the Original Code is: IBM Corporation
47 * Copyright: 2008 by IBM Corporation
49 * All Rights Reserved.
51 * Contributor(s): _______________________________________
54 ************************************************************************/
55 /**
56 * @file
57 * footnote
59 /*************************************************************************
60 * Change History
61 Mar 2005 Created
62 ************************************************************************/
63 #ifndef _LWPFRIBFOOTNOTE_HXX_
64 #define _LWPFRIBFOOTNOTE_HXX_
66 #include "lwpfrib.hxx"
67 #include "lwpobj.hxx"
68 #include "lwpsection.hxx"
69 #include "lwpborderstuff.hxx"
71 // Footnote types are built up from these numbers
72 #define FN_MASK_ENDNOTE 0x80
73 #define FN_MASK_SEPARATE 0x40
74 #define FN_MASK_DEACTIVATED 0x20
75 #define FN_MASK_BASE (0x0f | FN_MASK_ENDNOTE)
76 #define FN_BASE_DONTCARE 0
77 #define FN_BASE_FOOTNOTE 1
78 #define FN_BASE_DIVISION (2 | FN_MASK_ENDNOTE)
79 #define FN_BASE_DIVISIONGROUP (3 | FN_MASK_ENDNOTE)
80 #define FN_BASE_DOCUMENT (4 | FN_MASK_ENDNOTE)
82 // Here are the real footnote types
83 #define FN_DONTCARE (FN_BASE_DONTCARE)
84 #define FN_FOOTNOTE (FN_BASE_FOOTNOTE)
85 #define FN_DIVISION (FN_BASE_DIVISION)
86 #define FN_DIVISION_SEPARATE (FN_BASE_DIVISION | FN_MASK_SEPARATE)
87 #define FN_DIVISIONGROUP (FN_BASE_DIVISIONGROUP)
88 #define FN_DIVISIONGROUP_SEPARATE (FN_BASE_DIVISIONGROUP | FN_MASK_SEPARATE)
89 #define FN_DOCUMENT (FN_BASE_DOCUMENT)
90 #define FN_DOCUMENT_SEPARATE (FN_BASE_DOCUMENT | FN_MASK_SEPARATE)
91 #define STRID_FOOTCONTINUEDFROM "Continued from previous page..."
92 #define STRID_FOOTCONTINUEDON "Continued on next page..."
93 //Footnote table types, the string may have to do with local language
94 #define STR_DivisionFootnote "DivisionFootnote"
95 #define STR_DivisionEndnote "DivisionEndnote"
96 #define STR_DivisionGroupEndnote "DivisionGroupEndnote"
97 #define STR_DocumentEndnote "DocumentEndnote"
99 /**
100 * @brief Footnote frib object
102 class LwpFootnote;
103 class LwpFribFootnote: public LwpFrib
106 public:
107 LwpFribFootnote(LwpPara* pPara );
108 ~LwpFribFootnote(){};
109 void Read(LwpObjectStream* pObjStrm, sal_uInt16 len);
110 void RegisterStyle();
111 void XFConvert(XFContentContainer* pCont);
112 LwpFootnote* GetFootnote();
114 private:
115 LwpObjectID m_Footnote;
119 * @brief VO_FOOTNOTE object
121 class LwpSuperTableLayout;
122 class LwpEnSuperTableLayout;
123 class LwpFnSuperTableLayout;
124 class LwpCellLayout;
125 class LwpDocument;
126 class LwpTable;
127 class LwpFootnote : public LwpOrderedObject
129 public:
130 LwpFootnote(LwpObjectHeader &objHdr, LwpSvStream* pStrm);
131 ~LwpFootnote();
132 void RegisterStyle();
133 void XFConvert(XFContentContainer * pCont);
134 protected:
135 void Read();
136 private:
137 sal_uInt16 m_nType;
138 sal_uInt16 m_nRow;
139 LwpObjectID m_Content;
140 public:
141 sal_uInt16 GetType(){ return m_nType;}
142 private:
143 LwpCellLayout* GetCellLayout();
144 LwpEnSuperTableLayout* GetEnSuperTableLayout();
145 LwpDocument* GetFootnoteTableDivision();
146 LwpDocument* GetEndnoteDivision(LwpDocument* pPossible);
147 LwpEnSuperTableLayout* FindFootnoteTableLayout();
148 LwpTable* FindFootnoteTable();
149 LwpTable* GetFootnoteTable(LwpEnSuperTableLayout* pLayout);
150 LwpContent* FindFootnoteContent();
151 OUString GetTableClass();
155 * @brief VO_FOOTNOTETABLE object
157 #include "lwptable.hxx"
158 class LwpFootnoteTable : public LwpTable
160 public:
161 LwpFootnoteTable(LwpObjectHeader &objHdr, LwpSvStream* pStrm);
162 ~LwpFootnoteTable(){};
163 protected:
164 void Read();
168 * @brief footnote number options information
170 class LwpFootnoteNumberOptions
172 public:
173 LwpFootnoteNumberOptions(){};
174 ~LwpFootnoteNumberOptions(){};
175 void Read(LwpObjectStream* pObjStrm);
176 private:
177 sal_uInt16 m_nFlag;
178 sal_uInt16 m_nStartingNumber;
179 LwpAtomHolder m_LeadingText;
180 LwpAtomHolder m_TrailingText;
181 public:
182 enum // for flag
184 RESET_DOCUMENT = 0x00, // i.e., never reset the numbering
185 RESET_PAGE = 0x01,
186 RESET_DIVISION = 0x02,
187 RESET_DIVISIONGROUP = 0x04,
188 RESET_MASK = (RESET_PAGE | RESET_DIVISION | RESET_DIVISIONGROUP |
189 RESET_DOCUMENT),
190 SUPERSCRIPT_REFERENCE = 0x10
192 public:
193 sal_uInt16 GetStartingNumber(){ return m_nStartingNumber;}
194 OUString GetLeadingText(){ return m_LeadingText.str();}
195 OUString GetTrailingText(){ return m_TrailingText.str();}
196 sal_uInt16 GetReset(){ return static_cast<sal_uInt16>(m_nFlag & RESET_MASK);}
200 * @brief footnote separator options information
202 class LwpFootnoteSeparatorOptions
204 public:
205 LwpFootnoteSeparatorOptions(){};
206 ~LwpFootnoteSeparatorOptions(){};
207 void Read(LwpObjectStream* pObjStrm);
208 private:
209 sal_uInt16 m_nFlag;
210 sal_uInt32 m_nLength;
211 sal_uInt32 m_nIndent;
212 sal_uInt32 m_nAbove;
213 sal_uInt32 m_nBelow;
214 LwpBorderStuff m_BorderStuff;
215 public:
216 enum // for flag
218 HAS_SEPARATOR = 0x01,
219 CUSTOM_LENGTH = 0x02
221 public:
222 sal_uInt32 GetFlag(){ return m_nFlag;}
223 sal_uInt32 GetLength(){ return m_nLength;}
224 sal_uInt32 GetIndent(){ return m_nIndent;}
225 sal_uInt32 GetAbove(){ return m_nAbove;}
226 sal_uInt32 GetBelow(){ return m_nBelow;}
227 LwpBorderStuff* GetBorderStuff(){ return &m_BorderStuff;}
228 sal_Bool HasCustomLength(){ return (m_nFlag & CUSTOM_LENGTH) != 0;}
229 sal_Bool HasSeparator(){ return (m_nFlag & HAS_SEPARATOR) != 0;}
230 float GetTopBorderWidth(){ return m_BorderStuff.GetSideWidth(LwpBorderStuff::TOP);}
231 LwpColor GetTopBorderColor(){ return m_BorderStuff.GetSideColor(LwpBorderStuff::TOP);}
235 * @brief VO_FOOTNOTEOPTS object
237 class LwpFootnoteOptions : public LwpObject
239 public:
240 LwpFootnoteOptions(LwpObjectHeader &objHdr, LwpSvStream* pStrm);
241 ~LwpFootnoteOptions();
242 void RegisterStyle();
243 protected:
244 void Read();
245 void RegisterFootnoteStyle();
246 void RegisterEndnoteStyle();
247 private:
248 sal_uInt16 m_nFlag;
249 LwpFootnoteNumberOptions m_FootnoteNumbering;
250 LwpFootnoteNumberOptions m_EndnoteDivisionNumbering;
251 LwpFootnoteNumberOptions m_EndnoteDivisionGroupNumbering;
252 LwpFootnoteNumberOptions m_EndnoteDocNumbering;
253 LwpFootnoteSeparatorOptions m_FootnoteSeparator;
254 LwpFootnoteSeparatorOptions m_FootnoteContinuedSeparator;
255 LwpAtomHolder m_ContinuedOnMessage;
256 LwpAtomHolder m_ContinuedFromMessage;
257 OUString m_strMasterPage;
258 enum
260 FO_REPEAT = 0x0001,
261 FO_CONTINUEFROM = 0x0002,
262 FO_CONTINUEON = 0x0004,
263 FO_ON_CENTER = 0x0008,
264 FO_ON_RIGHT = 0x0010,
265 FO_ON_ALIGNMASK = FO_ON_CENTER | FO_ON_RIGHT,
266 FO_FROM_CENTER = 0x0020,
267 FO_FROM_RIGHT = 0x0040,
268 FO_FROM_ALIGNMASK = FO_FROM_CENTER | FO_FROM_RIGHT
271 public:
272 LwpFootnoteNumberOptions* GetFootnoteNumbering(){ return &m_FootnoteNumbering;}
273 LwpFootnoteNumberOptions* GetEndnoteDivisionNumbering(){ return &m_EndnoteDivisionNumbering;}
274 LwpFootnoteNumberOptions* GetEndnoteDivisionGroupNumbering(){ return &m_EndnoteDivisionGroupNumbering;}
275 LwpFootnoteNumberOptions* GetEndnoteDocNumbering(){ return &m_EndnoteDocNumbering;}
276 LwpFootnoteSeparatorOptions* GetFootnoteSeparator(){ return &m_FootnoteSeparator;}
277 LwpFootnoteSeparatorOptions* GetFootnoteContinuedSeparator(){ return &m_FootnoteContinuedSeparator;}
278 sal_Bool GetContinuedFrom(){ return ((m_nFlag & FO_CONTINUEFROM) != 0);}
279 sal_Bool GetContinuedOn(){ return ((m_nFlag & FO_CONTINUEON) != 0);}
280 OUString GetContinuedOnMessage();
281 OUString GetContinuedFromMessage();
282 void SetMasterPage(OUString strMasterPage){ m_strMasterPage = strMasterPage;}
285 #endif