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,
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 ************************************************************************/
58 * For LWP filter architecture prototype - footnote layouts
61 #include "lwpfnlayout.hxx"
63 LwpFootnoteLayout::LwpFootnoteLayout(LwpObjectHeader
&objHdr
, LwpSvStream
*pStrm
)
64 :LwpTableLayout(objHdr
, pStrm
)
68 LwpFootnoteLayout::~LwpFootnoteLayout()
72 * @descr Read object info
74 void LwpFootnoteLayout::Read()
76 LwpTableLayout::Read();
77 m_pObjStrm
->SkipExtra();
83 void LwpFootnoteLayout::RegisterStyle()
90 void LwpFootnoteLayout::XFConvert(XFContentContainer
* /*pCont*/)
94 LwpFnRowLayout::LwpFnRowLayout(LwpObjectHeader
&objHdr
, LwpSvStream
*pStrm
)
95 :LwpRowLayout(objHdr
, pStrm
)
99 LwpFnRowLayout::~LwpFnRowLayout()
103 * @descr Read object info
105 void LwpFnRowLayout::Read()
107 LwpRowLayout::Read();
108 m_pObjStrm
->SkipExtra();
112 * @descr Register footnote/endnote contents style
114 void LwpFnRowLayout::RegisterStyle()
116 // register cells' style
117 LwpObjectID
& rCellID
= GetChildHead();
118 LwpCellLayout
* pCellLayout
= dynamic_cast<LwpCellLayout
*>(rCellID
.obj().get());
122 pCellLayout
->SetFoundry(m_pFoundry
);
123 pCellLayout
->RegisterStyle();
124 rCellID
= pCellLayout
->GetNext();
125 pCellLayout
= dynamic_cast<LwpCellLayout
*>(rCellID
.obj().get());
132 void LwpFnRowLayout::XFConvert(XFContentContainer
* /*pCont*/)
136 LwpFnCellLayout::LwpFnCellLayout(LwpObjectHeader
&objHdr
, LwpSvStream
*pStrm
)
137 :LwpCellLayout(objHdr
, pStrm
)
141 LwpFnCellLayout::~LwpFnCellLayout()
145 * @descr Read object info
147 void LwpFnCellLayout::Read()
149 LwpCellLayout::Read();
150 m_pObjStrm
->SkipExtra();
154 * @descr Register footnote/endnote contents style
156 void LwpFnCellLayout::RegisterStyle()
158 // content object register styles
159 rtl::Reference
<LwpObject
> pObj
= m_Content
.obj();
162 pObj
->SetFoundry(m_pFoundry
);
163 pObj
->DoRegisterStyle();
170 void LwpFnCellLayout::XFConvert(XFContentContainer
* /*pCont*/)
174 LwpEndnoteLayout::LwpEndnoteLayout(LwpObjectHeader
&objHdr
, LwpSvStream
*pStrm
)
175 :LwpTableLayout(objHdr
, pStrm
)
179 LwpEndnoteLayout::~LwpEndnoteLayout()
183 * @descr Read object info
185 void LwpEndnoteLayout::Read()
187 LwpTableLayout::Read();
188 m_pObjStrm
->SkipExtra();
192 * @descr Register footnote/endnote contents style
194 void LwpEndnoteLayout::RegisterStyle()
196 // register style of rows
197 LwpObjectID
& rRowID
= GetChildHead();
198 LwpRowLayout
* pRowLayout
= dynamic_cast<LwpRowLayout
*>(rRowID
.obj().get());
201 pRowLayout
->SetFoundry(m_pFoundry
);
202 pRowLayout
->RegisterStyle();
204 rRowID
= pRowLayout
->GetNext();
205 pRowLayout
= dynamic_cast<LwpRowLayout
*>(rRowID
.obj().get());
212 void LwpEndnoteLayout::XFConvert(XFContentContainer
* /*pCont*/)
216 LwpEnSuperTableLayout::LwpEnSuperTableLayout(LwpObjectHeader
&objHdr
, LwpSvStream
*pStrm
)
217 :LwpSuperTableLayout(objHdr
, pStrm
)
221 LwpEnSuperTableLayout::~LwpEnSuperTableLayout()
225 * @descr Read object info
227 void LwpEnSuperTableLayout::Read()
229 LwpSuperTableLayout::Read();
230 m_pObjStrm
->SkipExtra();
233 void LwpEnSuperTableLayout::RegisterStyle()
235 // if this layout is style of real table entry
236 LwpVirtualLayout
* pTableLayout
= GetMainTableLayout();
237 if (pTableLayout
!= nullptr)
239 pTableLayout
->SetFoundry(m_pFoundry
);
240 pTableLayout
->DoRegisterStyle();
247 void LwpEnSuperTableLayout::XFConvert(XFContentContainer
* /*pCont*/)
252 * @short Get child endnote layout
253 * @return pointer to endnote layout
255 LwpVirtualLayout
* LwpEnSuperTableLayout::GetMainTableLayout()
257 LwpObjectID
& rID
= GetChildTail();
261 LwpVirtualLayout
* pLayout
= dynamic_cast<LwpVirtualLayout
*>(rID
.obj().get());
266 if (pLayout
&& pLayout
->GetLayoutType() == LWP_ENDNOTE_LAYOUT
)
270 rID
= pLayout
->GetPrevious();
276 LwpFnSuperTableLayout::LwpFnSuperTableLayout(LwpObjectHeader
&objHdr
, LwpSvStream
*pStrm
)
277 :LwpEnSuperTableLayout(objHdr
, pStrm
)
281 LwpFnSuperTableLayout::~LwpFnSuperTableLayout()
285 * @descr Read object info
287 void LwpFnSuperTableLayout::Read()
289 LwpEnSuperTableLayout::Read();
290 m_pObjStrm
->SkipExtra();
296 void LwpFnSuperTableLayout::RegisterStyle()
303 void LwpFnSuperTableLayout::XFConvert(XFContentContainer
* /*pCont*/)
308 * @short Get child footnote layout
309 * @return pointer to footnote layout
311 LwpVirtualLayout
* LwpFnSuperTableLayout::GetMainTableLayout()
313 LwpObjectID
& rID
= GetChildTail();
317 LwpVirtualLayout
* pLayout
= dynamic_cast<LwpVirtualLayout
*>(rID
.obj().get());
322 if (pLayout
&& pLayout
->GetLayoutType() == LWP_FOOTNOTE_LAYOUT
)
326 rID
= pLayout
->GetPrevious();
332 LwpContFromLayout::LwpContFromLayout(LwpObjectHeader
&objHdr
, LwpSvStream
*pStrm
)
333 :LwpPlacableLayout(objHdr
, pStrm
)
337 LwpContFromLayout::~LwpContFromLayout()
341 * @descr Read object info
343 void LwpContFromLayout::Read()
345 LwpPlacableLayout::Read();
346 m_pObjStrm
->SkipExtra();
352 void LwpContFromLayout::RegisterStyle()
359 void LwpContFromLayout::XFConvert(XFContentContainer
* /*pCont*/)
363 LwpContOnLayout::LwpContOnLayout(LwpObjectHeader
&objHdr
, LwpSvStream
*pStrm
)
364 :LwpPlacableLayout(objHdr
, pStrm
)
368 LwpContOnLayout::~LwpContOnLayout()
372 * @descr Read object info
374 void LwpContOnLayout::Read()
376 LwpPlacableLayout::Read();
377 m_pObjStrm
->SkipExtra();
383 void LwpContOnLayout::RegisterStyle()
390 void LwpContOnLayout::XFConvert(XFContentContainer
* /*pCont*/)
394 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */