build fix
[LibreOffice.git] / lotuswordpro / source / filter / lwpframelayout.hxx
blob24b51c0a08f11780e752b21a5534d7ed01be85f3
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,
29 * MA 02111-1307 USA
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 /*************************************************************************
57 * @file
58 * the class for VO_FrameLayout
59 ************************************************************************/
61 #ifndef INCLUDED_LOTUSWORDPRO_SOURCE_FILTER_LWPFRAMELAYOUT_HXX
62 #define INCLUDED_LOTUSWORDPRO_SOURCE_FILTER_LWPFRAMELAYOUT_HXX
64 #include "lwplayout.hxx"
65 #include "lwpstory.hxx"
66 #include "lwpmarker.hxx"
67 /**
68 * @brief For register frame style and parse frame
72 class LwpFrame
74 public:
75 explicit LwpFrame(LwpPlacableLayout* pLayout);
76 ~LwpFrame();
77 void RegisterStyle(XFFrameStyle* pFrameStyle);
78 void Parse(XFFrame* pXFFrame, sal_Int32 nPageNo);
79 void XFConvert(XFContentContainer* pCont);
80 private:
81 void ApplyWrapType(XFFrameStyle* pFrameStyle);
82 void ApplyMargins(XFFrameStyle* pFrameStyle);
83 void ApplyPadding(XFFrameStyle* pFrameStyle);
84 void ApplyBorders(XFFrameStyle* pFrameStyle);
85 void ApplyColumns(XFFrameStyle* pFrameStyle);
86 void ApplyShadow(XFFrameStyle* pFrameStyle);
87 void ApplyBackColor(XFFrameStyle* pFrameStyle);
88 void ApplyProtect(XFFrameStyle* pFrameStyle);
89 void ApplyTextDir(XFFrameStyle* pFrameStyle);
90 void ApplyPosType(XFFrameStyle* pFrameStyle);
91 void ApplyWatermark(XFFrameStyle* pFrameStyle);
92 void ApplyPatternFill(XFFrameStyle* pFrameStyle);
93 void ApplyBackGround(XFFrameStyle* pFrameStyle);
94 void ParseAnchorType(XFFrame* pXFFrame);
95 bool IsLeftWider();
96 private:
97 LwpPlacableLayout* m_pLayout;
98 OUString m_StyleName;
102 * @brief Frame link information
105 class LwpFrameLink
107 public:
108 LwpFrameLink();
109 ~LwpFrameLink();
110 void Read(LwpObjectStream* pStrm);
111 LwpObjectID& GetNextLayout(){ return m_NextLayout;}
112 LwpObjectID& GetPreviousLayout(){ return m_PreviousLayout;}
113 private:
114 LwpObjectID m_PreviousLayout;
115 LwpObjectID m_NextLayout;
119 * @brief VO_FRAMELAYOUT object
122 class LwpFrameLayout: public LwpPlacableLayout
124 public:
125 LwpFrameLayout(LwpObjectHeader &objHdr, LwpSvStream* pStrm);
126 virtual ~LwpFrameLayout() override;
127 virtual LWP_LAYOUT_TYPE GetLayoutType () override { return LWP_FRAME_LAYOUT;}
128 virtual void RegisterStyle() override;
129 virtual void XFConvert(XFContentContainer* pCont) override;
130 void XFConvertFrame(XFContentContainer* pCont, sal_Int32 nStart = 0, sal_Int32 nEnd = 0, bool bAll = false) override;
131 OUString GetNextLinkName();
132 bool HasPreviousLinkLayout();
133 bool IsForWaterMark() override;
134 double GetWidth() override;
135 void ApplyGraphicSize(XFFrame* pXFFrame);
136 protected:
137 void Read() override;
138 private:
139 double GetMaxWidth();
141 private:
142 LwpFrameLink m_Link;
143 std::unique_ptr<LwpFrame> m_pFrame;
144 bool m_bGettingMaxWidth;
148 * @brief VO_GROUPLAYOUT object , information for frame group layout
151 class LwpGroupLayout: public LwpPlacableLayout
153 public:
154 LwpGroupLayout(LwpObjectHeader &objHdr, LwpSvStream* pStrm);
155 virtual ~LwpGroupLayout() override;
156 virtual LWP_LAYOUT_TYPE GetLayoutType () override { return LWP_GROUP_LAYOUT;}
157 virtual void RegisterStyle() override;
158 virtual void XFConvert(XFContentContainer* pCont) override;
159 void XFConvertFrame(XFContentContainer* pCont, sal_Int32 nStart = 0, sal_Int32 nEnd = 0, bool bAll = false) override;
160 protected:
161 void Read() override;
162 private:
163 std::unique_ptr<LwpFrame> m_pFrame;
168 * @brief VO_GROUPFRAME object , information for frame group contents
171 class LwpGroupFrame: public LwpContent
173 public:
174 LwpGroupFrame(LwpObjectHeader &objHdr, LwpSvStream* pStrm);
175 virtual ~LwpGroupFrame() override;
176 virtual void RegisterStyle() override;
177 virtual void XFConvert(XFContentContainer* pCont) override;
178 protected:
179 void Read() override;
182 class LwpStory;
183 class LwpFoundry;
184 class LwpDropcapLayout : public LwpFrameLayout
186 public:
187 LwpDropcapLayout(LwpObjectHeader &objHdr, LwpSvStream* pStrm);
188 virtual ~LwpDropcapLayout() override {}
189 virtual LWP_LAYOUT_TYPE GetLayoutType () override { return LWP_DROPCAP_LAYOUT;}
190 virtual void Parse(IXFStream* pOutputStream) override;
191 virtual void XFConvert(XFContentContainer* pCont) override;
192 sal_uInt16 GetLines(){return m_nLines;}
193 void SetChars(sal_uInt32 nChars){ m_nChars += nChars;}
194 sal_uInt32 GetChars() const {return m_nChars;}
195 void RegisterStyle(LwpFoundry* pFoundry);
196 void RegisterStyle() override;
197 protected:
198 void Read() override;
199 private:
200 sal_uInt16 m_nLines;
201 sal_uInt32 m_nChars;
204 class LwpRubyLayout : public LwpFrameLayout
206 public:
207 LwpRubyLayout(LwpObjectHeader &objHdr, LwpSvStream* pStrm);
208 virtual ~LwpRubyLayout() override {}
209 LwpRubyMarker* GetMarker();
210 void ConvertContentText();
211 LwpStory* GetContentStory();
212 void RegisterStyle() override;
213 enum{
214 LEFT = 4,
215 RIGHT = 5,
216 CENTER = 2,
217 TOP = 1,
218 BOTTOM = 3
220 protected:
221 void Read() override;
222 private:
223 sal_uInt8 m_nPlacement;
224 sal_uInt8 m_nAlignment;
225 sal_uInt16 m_nStateFlag;
226 sal_Int32 m_nXOffset;
227 sal_Int32 m_nYOffset;
228 LwpObjectID m_objRubyMarker;
231 #endif
233 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */