Line data Source code
1 : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : /*************************************************************************
3 : *
4 : * The Contents of this file are made available subject to the terms of
5 : * either of the following licenses
6 : *
7 : * - GNU Lesser General Public License Version 2.1
8 : * - Sun Industry Standards Source License Version 1.1
9 : *
10 : * Sun Microsystems Inc., October, 2000
11 : *
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
16 : *
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.
20 : *
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.
25 : *
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
30 : *
31 : *
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.
38 : *
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.
45 : *
46 : * The Initial Developer of the Original Code is: IBM Corporation
47 : *
48 : * Copyright: 2008 by IBM Corporation
49 : *
50 : * All Rights Reserved.
51 : *
52 : * Contributor(s): _______________________________________
53 : *
54 : *
55 : ************************************************************************/
56 : /**
57 : * @file
58 : * footnote
59 : */
60 : /*************************************************************************
61 : * Change History
62 : Mar 2005 Created
63 : ************************************************************************/
64 : #ifndef _LWPFRIBFOOTNOTE_HXX_
65 : #define _LWPFRIBFOOTNOTE_HXX_
66 :
67 : #include "lwpfrib.hxx"
68 : #include "lwpobj.hxx"
69 : #include "lwpsection.hxx"
70 : #include "lwpborderstuff.hxx"
71 :
72 : // Footnote types are built up from these numbers
73 : #define FN_MASK_ENDNOTE 0x80
74 : #define FN_MASK_SEPARATE 0x40
75 : #define FN_MASK_DEACTIVATED 0x20
76 : #define FN_MASK_BASE (0x0f | FN_MASK_ENDNOTE)
77 : #define FN_BASE_DONTCARE 0
78 : #define FN_BASE_FOOTNOTE 1
79 : #define FN_BASE_DIVISION (2 | FN_MASK_ENDNOTE)
80 : #define FN_BASE_DIVISIONGROUP (3 | FN_MASK_ENDNOTE)
81 : #define FN_BASE_DOCUMENT (4 | FN_MASK_ENDNOTE)
82 :
83 : // Here are the real footnote types
84 : #define FN_DONTCARE (FN_BASE_DONTCARE)
85 : #define FN_FOOTNOTE (FN_BASE_FOOTNOTE)
86 : #define FN_DIVISION (FN_BASE_DIVISION)
87 : #define FN_DIVISION_SEPARATE (FN_BASE_DIVISION | FN_MASK_SEPARATE)
88 : #define FN_DIVISIONGROUP (FN_BASE_DIVISIONGROUP)
89 : #define FN_DIVISIONGROUP_SEPARATE (FN_BASE_DIVISIONGROUP | FN_MASK_SEPARATE)
90 : #define FN_DOCUMENT (FN_BASE_DOCUMENT)
91 : #define FN_DOCUMENT_SEPARATE (FN_BASE_DOCUMENT | FN_MASK_SEPARATE)
92 : #define STRID_FOOTCONTINUEDFROM "Continued from previous page..."
93 : #define STRID_FOOTCONTINUEDON "Continued on next page..."
94 : //Footnote table types, the string may have to do with local language
95 : #define STR_DivisionFootnote "DivisionFootnote"
96 : #define STR_DivisionEndnote "DivisionEndnote"
97 : #define STR_DivisionGroupEndnote "DivisionGroupEndnote"
98 : #define STR_DocumentEndnote "DocumentEndnote"
99 :
100 : /**
101 : * @brief Footnote frib object
102 : */
103 : class LwpFootnote;
104 : class LwpFribFootnote: public LwpFrib
105 : {
106 :
107 : public:
108 : LwpFribFootnote(LwpPara* pPara );
109 0 : virtual ~LwpFribFootnote(){}
110 : void Read(LwpObjectStream* pObjStrm, sal_uInt16 len) SAL_OVERRIDE;
111 : void RegisterNewStyle();
112 : void XFConvert(XFContentContainer* pCont);
113 : LwpFootnote* GetFootnote();
114 :
115 : private:
116 : LwpObjectID m_Footnote;
117 : };
118 :
119 : /**
120 : * @brief VO_FOOTNOTE object
121 : */
122 : class LwpEnSuperTableLayout;
123 : class LwpCellLayout;
124 : class LwpDocument;
125 : class LwpTable;
126 : class LwpFootnote : public LwpOrderedObject
127 : {
128 : public:
129 : LwpFootnote(LwpObjectHeader &objHdr, LwpSvStream* pStrm);
130 : virtual ~LwpFootnote();
131 : void RegisterStyle() SAL_OVERRIDE;
132 : void XFConvert(XFContentContainer * pCont) SAL_OVERRIDE;
133 : protected:
134 : void Read() SAL_OVERRIDE;
135 : private:
136 : sal_uInt16 m_nType;
137 : sal_uInt16 m_nRow;
138 : LwpObjectID m_Content;
139 : public:
140 0 : sal_uInt16 GetType(){ return m_nType;}
141 : private:
142 : LwpCellLayout* GetCellLayout();
143 : LwpDocument* GetFootnoteTableDivision();
144 : LwpDocument* GetEndnoteDivision(LwpDocument* pPossible);
145 : LwpEnSuperTableLayout* FindFootnoteTableLayout();
146 : LwpContent* FindFootnoteContent();
147 : OUString GetTableClass();
148 : };
149 :
150 : /**
151 : * @brief VO_FOOTNOTETABLE object
152 : */
153 : #include "lwptable.hxx"
154 : class LwpFootnoteTable : public LwpTable
155 : {
156 : public:
157 : LwpFootnoteTable(LwpObjectHeader &objHdr, LwpSvStream* pStrm);
158 0 : virtual ~LwpFootnoteTable(){}
159 : protected:
160 : void Read() SAL_OVERRIDE;
161 : };
162 :
163 : /**
164 : * @brief footnote number options information
165 : */
166 : class LwpFootnoteNumberOptions
167 : {
168 : public:
169 0 : LwpFootnoteNumberOptions()
170 : : m_nFlag(0)
171 0 : , m_nStartingNumber(0)
172 0 : {}
173 :
174 0 : ~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
183 : {
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
191 : };
192 : public:
193 0 : sal_uInt16 GetStartingNumber(){ return m_nStartingNumber;}
194 0 : OUString GetLeadingText(){ return m_LeadingText.str();}
195 0 : OUString GetTrailingText(){ return m_TrailingText.str();}
196 0 : sal_uInt16 GetReset(){ return static_cast<sal_uInt16>(m_nFlag & RESET_MASK);}
197 : };
198 :
199 : /**
200 : * @brief footnote separator options information
201 : */
202 : class LwpFootnoteSeparatorOptions
203 : {
204 : public:
205 0 : LwpFootnoteSeparatorOptions()
206 : : m_nFlag(0)
207 : , m_nLength(0)
208 : , m_nIndent(0)
209 : , m_nAbove(0)
210 0 : , m_nBelow(0)
211 0 : {}
212 :
213 0 : ~LwpFootnoteSeparatorOptions(){}
214 : void Read(LwpObjectStream* pObjStrm);
215 : private:
216 : sal_uInt16 m_nFlag;
217 : sal_uInt32 m_nLength;
218 : sal_uInt32 m_nIndent;
219 : sal_uInt32 m_nAbove;
220 : sal_uInt32 m_nBelow;
221 : LwpBorderStuff m_BorderStuff;
222 : public:
223 : enum // for flag
224 : {
225 : HAS_SEPARATOR = 0x01,
226 : CUSTOM_LENGTH = 0x02
227 : };
228 : public:
229 : sal_uInt32 GetFlag(){ return m_nFlag;}
230 0 : sal_uInt32 GetLength(){ return m_nLength;}
231 0 : sal_uInt32 GetIndent(){ return m_nIndent;}
232 0 : sal_uInt32 GetAbove(){ return m_nAbove;}
233 0 : sal_uInt32 GetBelow(){ return m_nBelow;}
234 : LwpBorderStuff* GetBorderStuff(){ return &m_BorderStuff;}
235 0 : sal_Bool HasCustomLength(){ return (m_nFlag & CUSTOM_LENGTH) != 0;}
236 0 : sal_Bool HasSeparator(){ return (m_nFlag & HAS_SEPARATOR) != 0;}
237 0 : float GetTopBorderWidth(){ return m_BorderStuff.GetSideWidth(LwpBorderStuff::TOP);}
238 0 : LwpColor GetTopBorderColor(){ return m_BorderStuff.GetSideColor(LwpBorderStuff::TOP);}
239 : };
240 :
241 : /**
242 : * @brief VO_FOOTNOTEOPTS object
243 : */
244 : class LwpFootnoteOptions : public LwpObject
245 : {
246 : public:
247 : LwpFootnoteOptions(LwpObjectHeader &objHdr, LwpSvStream* pStrm);
248 : virtual ~LwpFootnoteOptions();
249 : void RegisterStyle() SAL_OVERRIDE;
250 : protected:
251 : void Read() SAL_OVERRIDE;
252 : void RegisterFootnoteStyle();
253 : void RegisterEndnoteStyle();
254 : private:
255 : sal_uInt16 m_nFlag;
256 : LwpFootnoteNumberOptions m_FootnoteNumbering;
257 : LwpFootnoteNumberOptions m_EndnoteDivisionNumbering;
258 : LwpFootnoteNumberOptions m_EndnoteDivisionGroupNumbering;
259 : LwpFootnoteNumberOptions m_EndnoteDocNumbering;
260 : LwpFootnoteSeparatorOptions m_FootnoteSeparator;
261 : LwpFootnoteSeparatorOptions m_FootnoteContinuedSeparator;
262 : LwpAtomHolder m_ContinuedOnMessage;
263 : LwpAtomHolder m_ContinuedFromMessage;
264 : OUString m_strMasterPage;
265 : enum
266 : {
267 : FO_REPEAT = 0x0001,
268 : FO_CONTINUEFROM = 0x0002,
269 : FO_CONTINUEON = 0x0004,
270 : FO_ON_CENTER = 0x0008,
271 : FO_ON_RIGHT = 0x0010,
272 : FO_ON_ALIGNMASK = FO_ON_CENTER | FO_ON_RIGHT,
273 : FO_FROM_CENTER = 0x0020,
274 : FO_FROM_RIGHT = 0x0040,
275 : FO_FROM_ALIGNMASK = FO_FROM_CENTER | FO_FROM_RIGHT
276 : };
277 :
278 : public:
279 : LwpFootnoteNumberOptions* GetFootnoteNumbering(){ return &m_FootnoteNumbering;}
280 : LwpFootnoteNumberOptions* GetEndnoteDivisionNumbering(){ return &m_EndnoteDivisionNumbering;}
281 : LwpFootnoteNumberOptions* GetEndnoteDivisionGroupNumbering(){ return &m_EndnoteDivisionGroupNumbering;}
282 : LwpFootnoteNumberOptions* GetEndnoteDocNumbering(){ return &m_EndnoteDocNumbering;}
283 0 : LwpFootnoteSeparatorOptions* GetFootnoteSeparator(){ return &m_FootnoteSeparator;}
284 : LwpFootnoteSeparatorOptions* GetFootnoteContinuedSeparator(){ return &m_FootnoteContinuedSeparator;}
285 0 : sal_Bool GetContinuedFrom(){ return ((m_nFlag & FO_CONTINUEFROM) != 0);}
286 0 : sal_Bool GetContinuedOn(){ return ((m_nFlag & FO_CONTINUEON) != 0);}
287 : OUString GetContinuedOnMessage();
288 : OUString GetContinuedFromMessage();
289 0 : void SetMasterPage(const OUString& strMasterPage){ m_strMasterPage = strMasterPage;}
290 : };
291 :
292 : #endif
293 :
294 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|