update dev300-m57
[ooovba.git] / lotuswordpro / source / filter / lwpframelayout.hxx
blobbae778efdc8e3633959fb77759b2c286463f9352
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,
28 * MA 02111-1307 USA
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 /*************************************************************************
56 * @file
57 * the class for VO_FrameLayout
58 ************************************************************************/
59 /*************************************************************************
60 * Change History
61 Mar 2005 Created
62 ************************************************************************/
64 #ifndef _LWPFRAMELAYOUT_HXX
65 #define _LWPFRAMELAYOUT_HXX
67 #include "lwplayout.hxx"
68 #include "lwpstory.hxx"
69 #include "lwpmarker.hxx"
70 /**
71 * @brief For register frame style and parse frame
75 class LwpFrame
77 public:
78 LwpFrame(LwpPlacableLayout* pLayout);
79 ~LwpFrame();
80 void RegisterStyle(XFFrameStyle* pFrameStyle);
81 void Parse(XFFrame* pXFFrame, sal_Int32 nPageNo = 0);
82 void XFConvert(XFContentContainer* pCont);
83 private:
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);
98 // end add
99 void ParseAnchorType(XFFrame* pXFFrame);
100 sal_Bool IsLeftWider();
101 private:
102 LwpPlacableLayout* m_pLayout;
103 OUString m_StyleName;
107 * @brief Frame link information
110 class LwpFrameLink
112 public:
113 LwpFrameLink();
114 ~LwpFrameLink();
115 void Read(LwpObjectStream* pStrm);
116 LwpObjectID* GetNextLayout(){ return &m_NextLayout;}
117 LwpObjectID* GetPreviousLayout(){ return &m_PreviousLayout;}
118 private:
119 LwpObjectID m_PreviousLayout;
120 LwpObjectID m_NextLayout;
124 * @brief VO_FRAMELAYOUT object
127 class LwpFrameLayout: public LwpPlacableLayout
129 public:
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();
139 double GetWidth();
140 void ApplyGraphicSize(XFFrame* pXFFrame);
141 protected:
142 void Read();
143 private:
144 double GetMaxWidth();
146 private:
147 LwpFrameLink m_Link;
148 LwpFrame* m_pFrame;
152 * @brief VO_GROUPLAYOUT object , information for frame group layout
155 class LwpGroupLayout: public LwpPlacableLayout
157 public:
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);
164 protected:
165 void Read();
166 private:
167 LwpFrame* m_pFrame;
172 * @brief VO_GROUPFRAME object , information for frame group contents
175 class LwpGroupFrame: public LwpContent
177 public:
178 LwpGroupFrame(LwpObjectHeader &objHdr, LwpSvStream* pStrm);
179 ~LwpGroupFrame();
180 virtual void RegisterStyle();
181 virtual void XFConvert(XFContentContainer* pCont);
182 protected:
183 void Read();
186 class LwpStory;
187 class LwpFoundry;
188 class LwpDropcapLayout : public LwpFrameLayout
190 public:
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();
202 protected:
203 void Read();
204 private:
205 sal_uInt16 m_nLines;
206 sal_uInt32 m_nChars;
209 class LwpRubyLayout : public LwpFrameLayout
211 public:
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();
220 enum{
221 LEFT = 4,
222 RIGHT = 5,
223 CENTER = 2,
224 TOP = 1,
225 BOTTOM = 3
227 protected:
228 void Read();
229 private:
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;
236 sal_Int32 m_nBodyX;
237 sal_Int32 m_nBodyWidth;
240 #endif