tdf#131098 docx export: write fill property of graphic
[LibreOffice.git] / lotuswordpro / source / filter / lwpframelayout.hxx
blob351be2cc6d6eda15cf188648e9a89514d4728f25
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 <memory>
65 #include "lwplayout.hxx"
66 #include "lwpstory.hxx"
67 #include "lwpmarker.hxx"
68 #include <xfilter/xfframestyle.hxx>
69 #include <xfilter/xfframe.hxx>
71 /**
72 * @brief For register frame style and parse frame
76 class LwpFrame
78 public:
79 explicit LwpFrame(LwpPlacableLayout* pLayout);
80 ~LwpFrame();
81 void RegisterStyle(std::unique_ptr<XFFrameStyle>& rFrameStyle);
82 void Parse(XFFrame* pXFFrame, sal_Int32 nPageNo);
83 void XFConvert(XFContentContainer* pCont);
85 private:
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);
100 bool IsLeftWider();
102 private:
103 LwpPlacableLayout* m_pLayout;
104 OUString m_StyleName;
108 * @brief Frame link information
111 class LwpFrameLink
113 public:
114 LwpFrameLink();
115 void Read(LwpObjectStream* pStrm);
116 LwpObjectID& GetNextLayout() { return m_NextLayout; }
117 LwpObjectID& GetPreviousLayout() { return m_PreviousLayout; }
119 private:
120 LwpObjectID m_PreviousLayout;
121 LwpObjectID m_NextLayout;
125 * @brief VO_FRAMELAYOUT object
128 class LwpFrameLayout : public LwpPlacableLayout
130 public:
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);
144 protected:
145 void Read() override;
147 private:
148 double GetMaxWidth();
150 private:
151 LwpFrameLink m_Link;
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
162 public:
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;
171 protected:
172 void Read() override;
174 private:
175 std::unique_ptr<LwpFrame> m_pFrame;
179 * @brief VO_GROUPFRAME object , information for frame group contents
182 class LwpGroupFrame : public LwpContent
184 public:
185 LwpGroupFrame(LwpObjectHeader const& objHdr, LwpSvStream* pStrm);
186 virtual ~LwpGroupFrame() override;
187 virtual void RegisterStyle() override;
188 virtual void XFConvert(XFContentContainer* pCont) override;
190 protected:
191 void Read() override;
194 class LwpStory;
195 class LwpFoundry;
196 class LwpDropcapLayout : public LwpFrameLayout
198 public:
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;
209 protected:
210 void Read() override;
212 private:
213 sal_uInt16 m_nLines;
214 sal_uInt32 m_nChars;
217 class LwpRubyLayout : public LwpFrameLayout
219 public:
220 LwpRubyLayout(LwpObjectHeader const& objHdr, LwpSvStream* pStrm);
221 LwpRubyMarker* GetMarker();
222 void ConvertContentText();
223 LwpStory* GetContentStory();
224 void RegisterStyle() override;
225 enum
227 LEFT = 4,
228 RIGHT = 5,
229 CENTER = 2,
230 TOP = 1,
231 BOTTOM = 3
234 protected:
235 void Read() override;
237 private:
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;
246 #endif
248 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */