LibreOffice Module lotuswordpro (master) 1
lwpframelayout.hxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*************************************************************************
3 *
4 * The Contents of this file are made available subject to the terms of
5 * either of the following licenses
6 *
7 * - GNU Lesser General Public License Version 2.1
8 * - Sun Industry Standards Source License Version 1.1
9 *
10 * Sun Microsystems Inc., October, 2000
11 *
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
16 *
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.
20 *
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.
25 *
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
30 *
31 *
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.
38 *
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.
45 *
46 * The Initial Developer of the Original Code is: IBM Corporation
47 *
48 * Copyright: 2008 by IBM Corporation
49 *
50 * All Rights Reserved.
51 *
52 * Contributor(s): _______________________________________
53 *
54 *
55 ************************************************************************/
56/*************************************************************************
57 * @file
58 * the class for VO_FrameLayout
59 ************************************************************************/
60
61#ifndef INCLUDED_LOTUSWORDPRO_SOURCE_FILTER_LWPFRAMELAYOUT_HXX
62#define INCLUDED_LOTUSWORDPRO_SOURCE_FILTER_LWPFRAMELAYOUT_HXX
63
64#include <memory>
65#include "lwplayout.hxx"
66#include "lwpstory.hxx"
67#include "lwpmarker.hxx"
69#include <xfilter/xfframe.hxx>
70
77{
78public:
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);
84
85private:
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();
101
102private:
104 OUString m_StyleName;
105};
106
112{
113public:
114 LwpFrameLink();
115 void Read(LwpObjectStream* pStrm);
118
119private:
122};
123
129{
130public:
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();
140 bool IsForWaterMark() override;
141 double GetWidth() override;
142 void ApplyGraphicSize(XFFrame* pXFFrame);
143
144protected:
145 void Read() override;
146
147private:
148 double GetMaxWidth();
149
150private:
152 std::unique_ptr<LwpFrame> m_pFrame;
154};
155
161{
162public:
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;
170
171protected:
172 void Read() override;
173
174private:
175 std::unique_ptr<LwpFrame> m_pFrame;
176};
177
183{
184public:
185 LwpGroupFrame(LwpObjectHeader const& objHdr, LwpSvStream* pStrm);
186 virtual ~LwpGroupFrame() override;
187 virtual void RegisterStyle() override;
188 virtual void XFConvert(XFContentContainer* pCont) override;
189
190protected:
191 void Read() override;
192};
193
194class LwpStory;
195class LwpFoundry;
197{
198public:
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;
208
209protected:
210 void Read() override;
211
212private:
213 sal_uInt16 m_nLines;
214 sal_uInt32 m_nChars;
215};
216
218{
219public:
220 LwpRubyLayout(LwpObjectHeader const& objHdr, LwpSvStream* pStrm);
222 void ConvertContentText();
224 void RegisterStyle() override;
225 enum
226 {
227 LEFT = 4,
228 RIGHT = 5,
230 TOP = 1,
231 BOTTOM = 3
232 };
233
234protected:
235 void Read() override;
236
237private:
240 sal_uInt16 m_nStateFlag;
241 sal_Int32 m_nXOffset;
242 sal_Int32 m_nYOffset;
244};
245
246#endif
247
248/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Stream wrapper for sax writer.
Definition: ixfstream.hxx:72
Base class of all Lwp content objects.
Definition: lwpcontent.hxx:74
void SetChars(sal_uInt32 nChars)
void RegisterStyle() override
@descr do nothing
LwpDropcapLayout(LwpObjectHeader const &objHdr, LwpSvStream *pStrm)
virtual void Parse(IXFStream *pOutputStream) override
@descr default parse function
void Read() override
@descr read frame layout object
sal_uInt32 GetChars() const
virtual void XFConvert(XFContentContainer *pCont) override
@descr create a xfframe and add into content container
virtual LWP_LAYOUT_TYPE GetLayoutType() override
sal_uInt16 GetLines() const
VO_FRAMELAYOUT object.
virtual void XFConvert(XFContentContainer *pCont) override
@descr create a xfframe and add into content container
LwpFrameLayout(LwpObjectHeader const &objHdr, LwpSvStream *pStrm)
virtual LWP_LAYOUT_TYPE GetLayoutType() override
void Read() override
@descr read frame layout object
LwpFrameLink m_Link
bool IsForWaterMark() override
@descr whether current frame is for water mark.
double GetWidth() override
@descr Get frame width
double GetMaxWidth()
@descr Get frame width when the text field chooses maximize field length
void XFConvertFrame(XFContentContainer *pCont, sal_Int32 nStart=0, sal_Int32 nEnd=0, bool bAll=false) override
@descr create a xfframe and add into content container, called by XFConvert
virtual ~LwpFrameLayout() override
OUString GetNextLinkName()
@descr get the name of the frame that current frame links
void ApplyGraphicSize(XFFrame *pXFFrame)
@descr Set frame size according to graphic size
bool HasPreviousLinkLayout()
@descr whether current frame is linked by other frame
std::unique_ptr< LwpFrame > m_pFrame
virtual void RegisterStyle() override
@descr register frame style
For register frame style and parse frame.
LwpPlacableLayout * m_pLayout
void ParseAnchorType(XFFrame *pXFFrame)
@descr: set frame size, anchor type, anchored page number
void ApplyWrapType(XFFrameStyle *pFrameStyle)
@descr: set frame wrap type style
void ApplyProtect(XFFrameStyle *pFrameStyle)
@descr: set frame protect style
void XFConvert(XFContentContainer *pCont)
@descr: parse frame relative to page, frame or cell
void Parse(XFFrame *pXFFrame, sal_Int32 nPageNo)
@descr: parse frame and set frame properties
void ApplyBackGround(XFFrameStyle *pFrameStyle)
Apply background to frame style.
void ApplyBackColor(XFFrameStyle *pFrameStyle)
@descr: set frame back color style
void RegisterStyle(std::unique_ptr< XFFrameStyle > &rFrameStyle)
@descr: parse frame
void ApplyPosType(XFFrameStyle *pFrameStyle)
@descr: set frame position type style
void ApplyPadding(XFFrameStyle *pFrameStyle)
@descr: set padding border style
void ApplyShadow(XFFrameStyle *pFrameStyle)
@descr: set frame shadow style
bool IsLeftWider()
@descr Calculate the distance between the frame object and the page margins.
OUString m_StyleName
void ApplyWatermark(XFFrameStyle *pFrameStyle)
@descr: set frame watermark style
LwpFrame(LwpPlacableLayout *pLayout)
void ApplyMargins(XFFrameStyle *pFrameStyle)
@descr: set frame margins style
void ApplyBorders(XFFrameStyle *pFrameStyle)
@descr: set frame border style
void ApplyPatternFill(XFFrameStyle *pFrameStyle)
Apply pattern fill to frame style.
void ApplyColumns(XFFrameStyle *pFrameStyle)
@descr: set frame columns style
void ApplyTextDir(XFFrameStyle *pFrameStyle)
@descr: set frame text direction style
VO_GROUPFRAME object , information for frame group contents.
LwpGroupFrame(LwpObjectHeader const &objHdr, LwpSvStream *pStrm)
virtual ~LwpGroupFrame() override
virtual void XFConvert(XFContentContainer *pCont) override
@descr default XFConvert function pCont is the XFContentContainer for the object conversion
void Read() override
@descr default read function
virtual void RegisterStyle() override
@descr default register style function
VO_GROUPLAYOUT object , information for frame group layout.
void XFConvertFrame(XFContentContainer *pCont, sal_Int32 nStart=0, sal_Int32 nEnd=0, bool bAll=false) override
@descr create a xfframe and add into content container, called by XFConvert
virtual ~LwpGroupLayout() override
virtual void XFConvert(XFContentContainer *pCont) override
@descr create a xfframe and add into content container
virtual LWP_LAYOUT_TYPE GetLayoutType() override
void Read() override
@descr read group layout object
virtual void RegisterStyle() override
@descr register group frame style
LwpGroupLayout(LwpObjectHeader const &objHdr, LwpSvStream *pStrm)
std::unique_ptr< LwpFrame > m_pFrame
Base class of all Lwp VO objects.
Definition: lwpobjhdr.hxx:71
object id class
Definition: lwpobjid.hxx:79
stream class for LwpObject body data provide stream like interface to read object data
Definition: lwpobjstrm.hxx:77
LwpStory * GetContentStory()
sal_Int32 m_nYOffset
void Read() override
@descr read frame layout object
LwpRubyMarker * GetMarker()
sal_uInt16 m_nStateFlag
void RegisterStyle() override
@descr register frame style
sal_uInt8 m_nAlignment
sal_uInt8 m_nPlacement
sal_Int32 m_nXOffset
LwpObjectID m_objRubyMarker
LwpRubyLayout(LwpObjectHeader const &objHdr, LwpSvStream *pStrm)
encapsulate XInputStream to provide SvStream like interfaces
Definition: lwpsvstream.hxx:69
A container for content.
Style for all frame objects.
Base class for all frame object,include drawing,image,text-box.
Definition: xfframe.hxx:79
unsigned char sal_uInt8