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 ************************************************************************/
56 /*************************************************************************
58 * the class for VO_FrameLayout
59 ************************************************************************/
61 #ifndef INCLUDED_LOTUSWORDPRO_SOURCE_FILTER_LWPFRAMELAYOUT_HXX
62 #define INCLUDED_LOTUSWORDPRO_SOURCE_FILTER_LWPFRAMELAYOUT_HXX
65 #include "lwplayout.hxx"
66 #include "lwpstory.hxx"
67 #include "lwpmarker.hxx"
68 #include <xfilter/xfframestyle.hxx>
69 #include <xfilter/xfframe.hxx>
72 * @brief For register frame style and parse frame
79 explicit LwpFrame(LwpPlacableLayout
* pLayout
);
81 void RegisterStyle(std::unique_ptr
<XFFrameStyle
>& rFrameStyle
);
82 void Parse(XFFrame
* pXFFrame
, sal_Int32 nPageNo
);
83 void XFConvert(XFContentContainer
* pCont
);
86 void ApplyWrapType(XFFrameStyle
* pFrameStyle
);
87 void ApplyMargins(XFFrameStyle
* pFrameStyle
);
88 void ApplyPadding(XFFrameStyle
* pFrameStyle
);
89 void ApplyBorders(XFFrameStyle
* pFrameStyle
);
90 void ApplyColumns(XFFrameStyle
* pFrameStyle
);
91 void ApplyShadow(XFFrameStyle
* pFrameStyle
);
92 void ApplyBackColor(XFFrameStyle
* pFrameStyle
);
93 void ApplyProtect(XFFrameStyle
* pFrameStyle
);
94 void ApplyTextDir(XFFrameStyle
* pFrameStyle
);
95 void ApplyPosType(XFFrameStyle
* pFrameStyle
);
96 void ApplyWatermark(XFFrameStyle
* pFrameStyle
);
97 void ApplyPatternFill(XFFrameStyle
* pFrameStyle
);
98 void ApplyBackGround(XFFrameStyle
* pFrameStyle
);
99 void ParseAnchorType(XFFrame
* pXFFrame
);
103 LwpPlacableLayout
* m_pLayout
;
104 OUString m_StyleName
;
108 * @brief Frame link information
115 void Read(LwpObjectStream
* pStrm
);
116 LwpObjectID
& GetNextLayout() { return m_NextLayout
; }
117 LwpObjectID
& GetPreviousLayout() { return m_PreviousLayout
; }
120 LwpObjectID m_PreviousLayout
;
121 LwpObjectID m_NextLayout
;
125 * @brief VO_FRAMELAYOUT object
128 class LwpFrameLayout
: public LwpPlacableLayout
131 LwpFrameLayout(LwpObjectHeader
const& objHdr
, LwpSvStream
* pStrm
);
132 virtual ~LwpFrameLayout() override
;
133 virtual LWP_LAYOUT_TYPE
GetLayoutType() override
{ return LWP_FRAME_LAYOUT
; }
134 virtual void RegisterStyle() override
;
135 virtual void XFConvert(XFContentContainer
* pCont
) override
;
136 void XFConvertFrame(XFContentContainer
* pCont
, sal_Int32 nStart
= 0, sal_Int32 nEnd
= 0,
137 bool bAll
= false) override
;
138 OUString
GetNextLinkName();
139 bool HasPreviousLinkLayout();
140 bool IsForWaterMark() override
;
141 double GetWidth() override
;
142 void ApplyGraphicSize(XFFrame
* pXFFrame
);
145 void Read() override
;
148 double GetMaxWidth();
152 std::unique_ptr
<LwpFrame
> m_pFrame
;
153 bool m_bGettingMaxWidth
;
157 * @brief VO_GROUPLAYOUT object , information for frame group layout
160 class LwpGroupLayout
: public LwpPlacableLayout
163 LwpGroupLayout(LwpObjectHeader
const& objHdr
, LwpSvStream
* pStrm
);
164 virtual ~LwpGroupLayout() override
;
165 virtual LWP_LAYOUT_TYPE
GetLayoutType() override
{ return LWP_GROUP_LAYOUT
; }
166 virtual void RegisterStyle() override
;
167 virtual void XFConvert(XFContentContainer
* pCont
) override
;
168 void XFConvertFrame(XFContentContainer
* pCont
, sal_Int32 nStart
= 0, sal_Int32 nEnd
= 0,
169 bool bAll
= false) override
;
172 void Read() override
;
175 std::unique_ptr
<LwpFrame
> m_pFrame
;
179 * @brief VO_GROUPFRAME object , information for frame group contents
182 class LwpGroupFrame
: public LwpContent
185 LwpGroupFrame(LwpObjectHeader
const& objHdr
, LwpSvStream
* pStrm
);
186 virtual ~LwpGroupFrame() override
;
187 virtual void RegisterStyle() override
;
188 virtual void XFConvert(XFContentContainer
* pCont
) override
;
191 void Read() override
;
196 class LwpDropcapLayout
: public LwpFrameLayout
199 LwpDropcapLayout(LwpObjectHeader
const& objHdr
, LwpSvStream
* pStrm
);
200 virtual LWP_LAYOUT_TYPE
GetLayoutType() override
{ return LWP_DROPCAP_LAYOUT
; }
201 virtual void Parse(IXFStream
* pOutputStream
) override
;
202 virtual void XFConvert(XFContentContainer
* pCont
) override
;
203 sal_uInt16
GetLines() const { return m_nLines
; }
204 void SetChars(sal_uInt32 nChars
) { m_nChars
+= nChars
; }
205 sal_uInt32
GetChars() const { return m_nChars
; }
206 void RegisterStyle(LwpFoundry
* pFoundry
);
207 void RegisterStyle() override
;
210 void Read() override
;
217 class LwpRubyLayout
: public LwpFrameLayout
220 LwpRubyLayout(LwpObjectHeader
const& objHdr
, LwpSvStream
* pStrm
);
221 LwpRubyMarker
* GetMarker();
222 void ConvertContentText();
223 LwpStory
* GetContentStory();
224 void RegisterStyle() override
;
235 void Read() override
;
238 sal_uInt8 m_nPlacement
;
239 sal_uInt8 m_nAlignment
;
240 sal_uInt16 m_nStateFlag
;
241 sal_Int32 m_nXOffset
;
242 sal_Int32 m_nYOffset
;
243 LwpObjectID m_objRubyMarker
;
248 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */