1 /*************************************************************************
3 * The Contents of this file are made available subject to the terms of
4 * either of the following licenses
6 * - GNU Lesser General Public License Version 2.1
7 * - Sun Industry Standards Source License Version 1.1
9 * Sun Microsystems Inc., October, 2000
11 * GNU Lesser General Public License Version 2.1
12 * =============================================
13 * Copyright 2000 by Sun Microsystems, Inc.
14 * 901 San Antonio Road, Palo Alto, CA 94303, USA
16 * This library is free software; you can redistribute it and/or
17 * modify it under the terms of the GNU Lesser General Public
18 * License version 2.1, as published by the Free Software Foundation.
20 * This library is distributed in the hope that it will be useful,
21 * but WITHOUT ANY WARRANTY; without even the implied warranty of
22 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
23 * Lesser General Public License for more details.
25 * You should have received a copy of the GNU Lesser General Public
26 * License along with this library; if not, write to the Free Software
27 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
31 * Sun Industry Standards Source License Version 1.1
32 * =================================================
33 * The contents of this file are subject to the Sun Industry Standards
34 * Source License Version 1.1 (the "License"); You may not use this file
35 * except in compliance with the License. You may obtain a copy of the
36 * License at http://www.openoffice.org/license.html.
38 * Software provided under this License is provided on an "AS IS" basis,
39 * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
40 * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
41 * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
42 * See the License for the specific provisions governing your rights and
43 * obligations concerning the Software.
45 * The Initial Developer of the Original Code is: IBM Corporation
47 * Copyright: 2008 by IBM Corporation
49 * All Rights Reserved.
51 * Contributor(s): _______________________________________
54 ************************************************************************/
55 /*************************************************************************
57 * the class for VO_FrameLayout
58 ************************************************************************/
59 /*************************************************************************
62 ************************************************************************/
64 #ifndef _LWPFRAMELAYOUT_HXX
65 #define _LWPFRAMELAYOUT_HXX
67 #include "lwplayout.hxx"
68 #include "lwpstory.hxx"
69 #include "lwpmarker.hxx"
71 * @brief For register frame style and parse frame
78 LwpFrame(LwpPlacableLayout
* pLayout
);
80 void RegisterStyle(XFFrameStyle
* pFrameStyle
);
81 void Parse(XFFrame
* pXFFrame
, sal_Int32 nPageNo
= 0);
82 void XFConvert(XFContentContainer
* pCont
);
84 void ApplyWrapType(XFFrameStyle
* pFrameStyle
);
85 void ApplyMargins(XFFrameStyle
* pFrameStyle
);
86 void ApplyPadding(XFFrameStyle
* pFrameStyle
);
87 void ApplyBorders(XFFrameStyle
* pFrameStyle
);
88 void ApplyColumns(XFFrameStyle
* pFrameStyle
);
89 void ApplyShadow(XFFrameStyle
* pFrameStyle
);
90 void ApplyBackColor(XFFrameStyle
* pFrameStyle
);
91 void ApplyProtect(XFFrameStyle
* pFrameStyle
);
92 void ApplyTextDir(XFFrameStyle
* pFrameStyle
);
93 void ApplyPosType(XFFrameStyle
* pFrameStyle
);
94 void ApplyWatermark(XFFrameStyle
* pFrameStyle
);
95 // add by , 06/01/2005
96 void ApplyPatternFill(XFFrameStyle
* pFrameStyle
);
97 void ApplyBackGround(XFFrameStyle
* pFrameStyle
);
99 void ParseAnchorType(XFFrame
* pXFFrame
);
100 sal_Bool
IsLeftWider();
102 LwpPlacableLayout
* m_pLayout
;
103 OUString m_StyleName
;
107 * @brief Frame link information
115 void Read(LwpObjectStream
* pStrm
);
116 LwpObjectID
* GetNextLayout(){ return &m_NextLayout
;}
117 LwpObjectID
* GetPreviousLayout(){ return &m_PreviousLayout
;}
119 LwpObjectID m_PreviousLayout
;
120 LwpObjectID m_NextLayout
;
124 * @brief VO_FRAMELAYOUT object
127 class LwpFrameLayout
: public LwpPlacableLayout
130 LwpFrameLayout(LwpObjectHeader
&objHdr
, LwpSvStream
* pStrm
);
131 virtual ~LwpFrameLayout();
132 virtual LWP_LAYOUT_TYPE
GetLayoutType () { return LWP_FRAME_LAYOUT
;}
133 virtual void RegisterStyle();
134 virtual void XFConvert(XFContentContainer
* pCont
);
135 void XFConvertFrame(XFContentContainer
* pCont
, sal_Int32 nStart
= 0, sal_Int32 nEnd
= 0, sal_Bool bAll
= sal_False
);
136 OUString
GetNextLinkName();
137 sal_Bool
HasPreviousLinkLayout();
138 sal_Bool
IsForWaterMark();
140 void ApplyGraphicSize(XFFrame
* pXFFrame
);
144 double GetMaxWidth();
152 * @brief VO_GROUPLAYOUT object , information for frame group layout
155 class LwpGroupLayout
: public LwpPlacableLayout
158 LwpGroupLayout(LwpObjectHeader
&objHdr
, LwpSvStream
* pStrm
);
159 virtual ~LwpGroupLayout();
160 virtual LWP_LAYOUT_TYPE
GetLayoutType () { return LWP_GROUP_LAYOUT
;}
161 virtual void RegisterStyle();
162 virtual void XFConvert(XFContentContainer
* pCont
);
163 void XFConvertFrame(XFContentContainer
* pCont
, sal_Int32 nStart
= 0, sal_Int32 nEnd
= 0, sal_Bool bAll
= sal_False
);
172 * @brief VO_GROUPFRAME object , information for frame group contents
175 class LwpGroupFrame
: public LwpContent
178 LwpGroupFrame(LwpObjectHeader
&objHdr
, LwpSvStream
* pStrm
);
180 virtual void RegisterStyle();
181 virtual void XFConvert(XFContentContainer
* pCont
);
188 class LwpDropcapLayout
: public LwpFrameLayout
191 LwpDropcapLayout(LwpObjectHeader
&objHdr
, LwpSvStream
* pStrm
);
192 virtual ~LwpDropcapLayout(){};
193 virtual LWP_LAYOUT_TYPE
GetLayoutType () { return LWP_DROPCAP_LAYOUT
;}
194 virtual void Parse(IXFStream
* pOutputStream
);
195 virtual void XFConvert(XFContentContainer
* pCont
);
196 sal_uInt16
GetLines(){return m_nLines
;}
197 void SetChars(sal_uInt32 nChars
){ m_nChars
+= nChars
;}
198 sal_uInt32
GetChars() const {return m_nChars
;}
199 LwpStory
* GetContentStory();
200 void RegisterStyle(LwpFoundry
* pFoundry
);
201 void RegisterStyle();
209 class LwpRubyLayout
: public LwpFrameLayout
212 LwpRubyLayout(LwpObjectHeader
&objHdr
, LwpSvStream
* pStrm
);
213 virtual ~LwpRubyLayout(){};
214 LwpRubyMarker
* GetMarker();
215 void ConvertContentText();
216 LwpStory
* GetContentStory();
217 sal_uInt8
GetPosition(){return m_nPlacement
;}
218 sal_uInt8
GetAlignment(){return m_nAlignment
;}
219 void RegisterStyle();
230 sal_uInt8 m_nPlacement
;
231 sal_uInt8 m_nAlignment
;
232 sal_uInt16 m_nStateFlag
;
233 sal_Int32 m_nXOffset
;
234 sal_Int32 m_nYOffset
;
235 LwpObjectID m_objRubyMarker
;
237 sal_Int32 m_nBodyWidth
;