Version 5.2.6.1, tag libreoffice-5.2.6.1
[LibreOffice.git] / lotuswordpro / source / filter / lwpfootnote.hxx
blobd01c52b1ac8b9c676a5a98fb16d9764faf0e491e
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*************************************************************************
4 * The Contents of this file are made available subject to the terms of
5 * either of the following licenses
7 * - GNU Lesser General Public License Version 2.1
8 * - Sun Industry Standards Source License Version 1.1
10 * Sun Microsystems Inc., October, 2000
12 * GNU Lesser General Public License Version 2.1
13 * =============================================
14 * Copyright 2000 by Sun Microsystems, Inc.
15 * 901 San Antonio Road, Palo Alto, CA 94303, USA
17 * This library is free software; you can redistribute it and/or
18 * modify it under the terms of the GNU Lesser General Public
19 * License version 2.1, as published by the Free Software Foundation.
21 * This library is distributed in the hope that it will be useful,
22 * but WITHOUT ANY WARRANTY; without even the implied warranty of
23 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
24 * Lesser General Public License for more details.
26 * You should have received a copy of the GNU Lesser General Public
27 * License along with this library; if not, write to the Free Software
28 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
29 * MA 02111-1307 USA
32 * Sun Industry Standards Source License Version 1.1
33 * =================================================
34 * The contents of this file are subject to the Sun Industry Standards
35 * Source License Version 1.1 (the "License"); You may not use this file
36 * except in compliance with the License. You may obtain a copy of the
37 * License at http://www.openoffice.org/license.html.
39 * Software provided under this License is provided on an "AS IS" basis,
40 * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
41 * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
42 * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
43 * See the License for the specific provisions governing your rights and
44 * obligations concerning the Software.
46 * The Initial Developer of the Original Code is: IBM Corporation
48 * Copyright: 2008 by IBM Corporation
50 * All Rights Reserved.
52 * Contributor(s): _______________________________________
55 ************************************************************************/
56 /**
57 * @file
58 * footnote
61 #ifndef INCLUDED_LOTUSWORDPRO_SOURCE_FILTER_LWPFOOTNOTE_HXX
62 #define INCLUDED_LOTUSWORDPRO_SOURCE_FILTER_LWPFOOTNOTE_HXX
64 #include "lwpfrib.hxx"
65 #include "lwpobj.hxx"
66 #include "lwpsection.hxx"
67 #include "lwpborderstuff.hxx"
69 // Footnote types are built up from these numbers
70 #define FN_MASK_ENDNOTE 0x80
71 #define FN_MASK_SEPARATE 0x40
72 #define FN_MASK_DEACTIVATED 0x20
73 #define FN_MASK_BASE (0x0f | FN_MASK_ENDNOTE)
74 #define FN_BASE_DONTCARE 0
75 #define FN_BASE_FOOTNOTE 1
76 #define FN_BASE_DIVISION (2 | FN_MASK_ENDNOTE)
77 #define FN_BASE_DIVISIONGROUP (3 | FN_MASK_ENDNOTE)
78 #define FN_BASE_DOCUMENT (4 | FN_MASK_ENDNOTE)
80 // Here are the real footnote types
81 #define FN_DONTCARE (FN_BASE_DONTCARE)
82 #define FN_FOOTNOTE (FN_BASE_FOOTNOTE)
83 #define FN_DIVISION (FN_BASE_DIVISION)
84 #define FN_DIVISION_SEPARATE (FN_BASE_DIVISION | FN_MASK_SEPARATE)
85 #define FN_DIVISIONGROUP (FN_BASE_DIVISIONGROUP)
86 #define FN_DIVISIONGROUP_SEPARATE (FN_BASE_DIVISIONGROUP | FN_MASK_SEPARATE)
87 #define FN_DOCUMENT (FN_BASE_DOCUMENT)
88 #define FN_DOCUMENT_SEPARATE (FN_BASE_DOCUMENT | FN_MASK_SEPARATE)
89 #define STRID_FOOTCONTINUEDFROM "Continued from previous page..."
90 #define STRID_FOOTCONTINUEDON "Continued on next page..."
91 //Footnote table types, the string may have to do with local language
92 #define STR_DivisionFootnote "DivisionFootnote"
93 #define STR_DivisionEndnote "DivisionEndnote"
94 #define STR_DivisionGroupEndnote "DivisionGroupEndnote"
95 #define STR_DocumentEndnote "DocumentEndnote"
97 /**
98 * @brief Footnote frib object
100 class LwpFootnote;
101 class LwpFribFootnote: public LwpFrib
104 public:
105 explicit LwpFribFootnote(LwpPara* pPara );
106 virtual ~LwpFribFootnote(){}
107 void Read(LwpObjectStream* pObjStrm, sal_uInt16 len) override;
108 void RegisterNewStyle();
109 void XFConvert(XFContentContainer* pCont);
110 LwpFootnote* GetFootnote();
112 private:
113 LwpObjectID m_Footnote;
117 * @brief VO_FOOTNOTE object
119 class LwpEnSuperTableLayout;
120 class LwpCellLayout;
121 class LwpDocument;
122 class LwpTable;
123 class LwpFootnote : public LwpOrderedObject
125 public:
126 LwpFootnote(LwpObjectHeader &objHdr, LwpSvStream* pStrm);
127 virtual ~LwpFootnote();
128 void RegisterStyle() override;
129 void XFConvert(XFContentContainer * pCont) override;
130 protected:
131 void Read() override;
132 private:
133 sal_uInt16 m_nType;
134 sal_uInt16 m_nRow;
135 LwpObjectID m_Content;
136 public:
137 sal_uInt16 GetType(){ return m_nType;}
138 private:
139 LwpCellLayout* GetCellLayout();
140 LwpDocument* GetFootnoteTableDivision();
141 LwpDocument* GetEndnoteDivision(LwpDocument* pPossible);
142 LwpEnSuperTableLayout* FindFootnoteTableLayout();
143 LwpContent* FindFootnoteContent();
144 OUString GetTableClass();
148 * @brief VO_FOOTNOTETABLE object
150 #include "lwptable.hxx"
151 class LwpFootnoteTable : public LwpTable
153 public:
154 LwpFootnoteTable(LwpObjectHeader &objHdr, LwpSvStream* pStrm);
155 virtual ~LwpFootnoteTable(){}
156 protected:
157 void Read() override;
161 * @brief footnote number options information
163 class LwpFootnoteNumberOptions
165 public:
166 LwpFootnoteNumberOptions()
167 : m_nFlag(0)
168 , m_nStartingNumber(0)
171 ~LwpFootnoteNumberOptions(){}
172 void Read(LwpObjectStream* pObjStrm);
173 private:
174 sal_uInt16 m_nFlag;
175 sal_uInt16 m_nStartingNumber;
176 LwpAtomHolder m_LeadingText;
177 LwpAtomHolder m_TrailingText;
178 public:
179 enum // for flag
181 RESET_DOCUMENT = 0x00, // i.e., never reset the numbering
182 RESET_PAGE = 0x01,
183 RESET_DIVISION = 0x02,
184 RESET_DIVISIONGROUP = 0x04,
185 RESET_MASK = (RESET_PAGE | RESET_DIVISION | RESET_DIVISIONGROUP |
186 RESET_DOCUMENT),
187 SUPERSCRIPT_REFERENCE = 0x10
189 public:
190 sal_uInt16 GetStartingNumber(){ return m_nStartingNumber;}
191 OUString GetLeadingText(){ return m_LeadingText.str();}
192 OUString GetTrailingText(){ return m_TrailingText.str();}
193 sal_uInt16 GetReset(){ return static_cast<sal_uInt16>(m_nFlag & RESET_MASK);}
197 * @brief footnote separator options information
199 class LwpFootnoteSeparatorOptions
201 public:
202 LwpFootnoteSeparatorOptions()
203 : m_nFlag(0)
204 , m_nLength(0)
205 , m_nIndent(0)
206 , m_nAbove(0)
207 , m_nBelow(0)
210 ~LwpFootnoteSeparatorOptions(){}
211 void Read(LwpObjectStream* pObjStrm);
212 private:
213 sal_uInt16 m_nFlag;
214 sal_uInt32 m_nLength;
215 sal_uInt32 m_nIndent;
216 sal_uInt32 m_nAbove;
217 sal_uInt32 m_nBelow;
218 LwpBorderStuff m_BorderStuff;
219 public:
220 enum // for flag
222 HAS_SEPARATOR = 0x01,
223 CUSTOM_LENGTH = 0x02
225 sal_uInt32 GetLength(){ return m_nLength;}
226 sal_uInt32 GetIndent(){ return m_nIndent;}
227 sal_uInt32 GetAbove(){ return m_nAbove;}
228 sal_uInt32 GetBelow(){ return m_nBelow;}
229 bool HasCustomLength(){ return (m_nFlag & CUSTOM_LENGTH) != 0;}
230 bool HasSeparator(){ return (m_nFlag & HAS_SEPARATOR) != 0;}
231 float GetTopBorderWidth(){ return m_BorderStuff.GetSideWidth(LwpBorderStuff::TOP);}
232 LwpColor GetTopBorderColor(){ return m_BorderStuff.GetSideColor(LwpBorderStuff::TOP);}
236 * @brief VO_FOOTNOTEOPTS object
238 class LwpFootnoteOptions : public LwpObject
240 public:
241 LwpFootnoteOptions(LwpObjectHeader &objHdr, LwpSvStream* pStrm);
242 void RegisterStyle() override;
243 protected:
244 void Read() override;
245 void RegisterFootnoteStyle();
246 void RegisterEndnoteStyle();
247 private:
248 virtual ~LwpFootnoteOptions();
250 sal_uInt16 m_nFlag;
251 LwpFootnoteNumberOptions m_FootnoteNumbering;
252 LwpFootnoteNumberOptions m_EndnoteDivisionNumbering;
253 LwpFootnoteNumberOptions m_EndnoteDivisionGroupNumbering;
254 LwpFootnoteNumberOptions m_EndnoteDocNumbering;
255 LwpFootnoteSeparatorOptions m_FootnoteSeparator;
256 LwpFootnoteSeparatorOptions m_FootnoteContinuedSeparator;
257 LwpAtomHolder m_ContinuedOnMessage;
258 LwpAtomHolder m_ContinuedFromMessage;
259 OUString m_strMasterPage;
260 enum
262 FO_REPEAT = 0x0001,
263 FO_CONTINUEFROM = 0x0002,
264 FO_CONTINUEON = 0x0004,
265 FO_ON_CENTER = 0x0008,
266 FO_ON_RIGHT = 0x0010,
267 FO_ON_ALIGNMASK = FO_ON_CENTER | FO_ON_RIGHT,
268 FO_FROM_CENTER = 0x0020,
269 FO_FROM_RIGHT = 0x0040,
270 FO_FROM_ALIGNMASK = FO_FROM_CENTER | FO_FROM_RIGHT
273 public:
274 LwpFootnoteSeparatorOptions& GetFootnoteSeparator(){ return m_FootnoteSeparator;}
275 bool GetContinuedFrom(){ return ((m_nFlag & FO_CONTINUEFROM) != 0);}
276 bool GetContinuedOn(){ return ((m_nFlag & FO_CONTINUEON) != 0);}
277 OUString GetContinuedOnMessage();
278 OUString GetContinuedFromMessage();
279 void SetMasterPage(const OUString& strMasterPage){ m_strMasterPage = strMasterPage;}
282 #endif
284 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */