tdf#137105: crash in table with Style Inspector active
[LibreOffice.git] / lotuswordpro / source / filter / lwpfootnote.hxx
blob5163204e39eaedb01cda806d8e8cc3d07353256d
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"
68 #include "lwptable.hxx"
70 // Footnote types are built up from these numbers
71 #define FN_MASK_ENDNOTE 0x80
72 #define FN_MASK_SEPARATE 0x40
73 #define FN_MASK_DEACTIVATED 0x20
74 #define FN_MASK_BASE (0x0f | FN_MASK_ENDNOTE)
75 #define FN_BASE_DONTCARE 0
76 #define FN_BASE_FOOTNOTE 1
77 #define FN_BASE_DIVISION (2 | FN_MASK_ENDNOTE)
78 #define FN_BASE_DIVISIONGROUP (3 | FN_MASK_ENDNOTE)
79 #define FN_BASE_DOCUMENT (4 | FN_MASK_ENDNOTE)
81 // Here are the real footnote types
82 #define FN_DONTCARE (FN_BASE_DONTCARE)
83 #define FN_FOOTNOTE (FN_BASE_FOOTNOTE)
84 #define FN_DIVISION (FN_BASE_DIVISION)
85 #define FN_DIVISION_SEPARATE (FN_BASE_DIVISION | FN_MASK_SEPARATE)
86 #define FN_DIVISIONGROUP (FN_BASE_DIVISIONGROUP)
87 #define FN_DIVISIONGROUP_SEPARATE (FN_BASE_DIVISIONGROUP | FN_MASK_SEPARATE)
88 #define FN_DOCUMENT (FN_BASE_DOCUMENT)
89 #define FN_DOCUMENT_SEPARATE (FN_BASE_DOCUMENT | FN_MASK_SEPARATE)
90 #define STRID_FOOTCONTINUEDFROM "Continued from previous page..."
91 #define STRID_FOOTCONTINUEDON "Continued on next page..."
92 //Footnote table types, the string may have to do with local language
93 #define STR_DivisionFootnote "DivisionFootnote"
94 #define STR_DivisionEndnote "DivisionEndnote"
95 #define STR_DivisionGroupEndnote "DivisionGroupEndnote"
96 #define STR_DocumentEndnote "DocumentEndnote"
98 /**
99 * @brief Footnote frib object
101 class LwpFootnote;
102 class LwpFribFootnote: public LwpFrib
105 public:
106 explicit LwpFribFootnote(LwpPara* pPara );
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 const &objHdr, LwpSvStream* pStrm);
127 virtual ~LwpFootnote() override;
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() const { 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() const;
148 * @brief VO_FOOTNOTETABLE object
150 class LwpFootnoteTable : public LwpTable
152 public:
153 LwpFootnoteTable(LwpObjectHeader const &objHdr, LwpSvStream* pStrm);
154 protected:
155 void Read() override;
159 * @brief footnote number options information
161 class LwpFootnoteNumberOptions
163 public:
164 LwpFootnoteNumberOptions()
165 : m_nFlag(0)
166 , m_nStartingNumber(0)
169 void Read(LwpObjectStream* pObjStrm);
170 private:
171 sal_uInt16 m_nFlag;
172 sal_uInt16 m_nStartingNumber;
173 LwpAtomHolder m_LeadingText;
174 LwpAtomHolder m_TrailingText;
175 public:
176 enum // for flag
178 RESET_DOCUMENT = 0x00, // i.e., never reset the numbering
179 RESET_PAGE = 0x01,
180 RESET_DIVISION = 0x02,
181 RESET_DIVISIONGROUP = 0x04,
182 RESET_MASK = (RESET_PAGE | RESET_DIVISION | RESET_DIVISIONGROUP |
183 RESET_DOCUMENT),
184 SUPERSCRIPT_REFERENCE = 0x10
186 public:
187 sal_uInt16 GetStartingNumber() const { return m_nStartingNumber;}
188 OUString const & GetLeadingText() const { return m_LeadingText.str();}
189 OUString const & GetTrailingText() const { return m_TrailingText.str();}
190 sal_uInt16 GetReset() const { return static_cast<sal_uInt16>(m_nFlag & RESET_MASK);}
194 * @brief footnote separator options information
196 class LwpFootnoteSeparatorOptions
198 public:
199 LwpFootnoteSeparatorOptions()
200 : m_nFlag(0)
201 , m_nLength(0)
202 , m_nIndent(0)
203 , m_nAbove(0)
204 , m_nBelow(0)
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 sal_uInt32 GetLength() const { return m_nLength;}
222 sal_uInt32 GetIndent() const { return m_nIndent;}
223 sal_uInt32 GetAbove() const { return m_nAbove;}
224 sal_uInt32 GetBelow() const { return m_nBelow;}
225 bool HasCustomLength() const { return (m_nFlag & CUSTOM_LENGTH) != 0;}
226 bool HasSeparator() const { return (m_nFlag & HAS_SEPARATOR) != 0;}
227 float GetTopBorderWidth(){ return m_BorderStuff.GetSideWidth(LwpBorderStuff::TOP);}
228 LwpColor GetTopBorderColor(){ return m_BorderStuff.GetSideColor(LwpBorderStuff::TOP);}
232 * @brief VO_FOOTNOTEOPTS object
234 class LwpFootnoteOptions final : public LwpObject
236 public:
237 LwpFootnoteOptions(LwpObjectHeader const &objHdr, LwpSvStream* pStrm);
238 void RegisterStyle() override;
239 private:
240 void Read() override;
241 void RegisterFootnoteStyle();
242 void RegisterEndnoteStyle();
243 virtual ~LwpFootnoteOptions() override;
245 sal_uInt16 m_nFlag;
246 LwpFootnoteNumberOptions m_FootnoteNumbering;
247 LwpFootnoteNumberOptions m_EndnoteDivisionNumbering;
248 LwpFootnoteNumberOptions m_EndnoteDivisionGroupNumbering;
249 LwpFootnoteNumberOptions m_EndnoteDocNumbering;
250 LwpFootnoteSeparatorOptions m_FootnoteSeparator;
251 LwpFootnoteSeparatorOptions m_FootnoteContinuedSeparator;
252 LwpAtomHolder m_ContinuedOnMessage;
253 LwpAtomHolder m_ContinuedFromMessage;
254 OUString m_strMasterPage;
255 enum
257 FO_REPEAT = 0x0001,
258 FO_CONTINUEFROM = 0x0002,
259 FO_CONTINUEON = 0x0004,
260 FO_ON_CENTER = 0x0008,
261 FO_ON_RIGHT = 0x0010,
262 FO_ON_ALIGNMASK = FO_ON_CENTER | FO_ON_RIGHT,
263 FO_FROM_CENTER = 0x0020,
264 FO_FROM_RIGHT = 0x0040,
265 FO_FROM_ALIGNMASK = FO_FROM_CENTER | FO_FROM_RIGHT
268 public:
269 LwpFootnoteSeparatorOptions& GetFootnoteSeparator(){ return m_FootnoteSeparator;}
270 bool GetContinuedFrom() const { return ((m_nFlag & FO_CONTINUEFROM) != 0);}
271 bool GetContinuedOn() const { return ((m_nFlag & FO_CONTINUEON) != 0);}
272 OUString GetContinuedOnMessage() const;
273 OUString GetContinuedFromMessage() const;
274 void SetMasterPage(const OUString& strMasterPage){ m_strMasterPage = strMasterPage;}
277 #endif
279 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */