LibreOffice Module lotuswordpro (master) 1
xfframe.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 * Frame object for OOo.This is the basic object for all Shape Layer.
59 * You can reference to the XFFrame object.
60 ************************************************************************/
61#ifndef INCLUDED_LOTUSWORDPRO_INC_XFILTER_XFFRAME_HXX
62#define INCLUDED_LOTUSWORDPRO_INC_XFILTER_XFFRAME_HXX
63
64#include <xfilter/xfcontent.hxx>
65#include <xfilter/xfrect.hxx>
67
68#define XFFRAME_FLAG_HEIGHT 0x00000001
69#define XFFRAME_FLAG_MINHEIGHT 0x00000002
70#define XFFRAME_FLAG_MAXHEIGHT 0x00000004
79{
80public:
81 XFFrame();
82 explicit XFFrame(bool isTextBox);
83
84 virtual ~XFFrame() override;
85
86public:
88
92 virtual void Add(XFContent *pContent) override;
93
98
102 void SetAnchorPage(sal_Int32 page);
103
107 void SetName(const OUString& name);
108
112 void SetZIndex(sal_uInt32 zIndex);
116 void SetX(double x);
117
121 void SetY(double y);
122
126 void SetWidth(double width);
127
131 void SetHeight(double height);
132
136 void SetMinHeight(double minHeight);
137
141 void SetPosition(double x, double y, double width, double height);
142
146 void SetPosition(const XFRect& rect);
147
151 void SetNextLink(const OUString& next);
152
157
161 virtual enumXFContent GetContentType() override;
162
166 virtual void ToXml(IXFStream *pStrm) override;
167
168private:
169 void StartFrame(IXFStream *pStrm);
170
171 static void EndFrame(IXFStream *pStrm);
172
173 void AdjustZIndex();
174
175protected:
177 sal_Int32 m_nAnchorPage;
178 OUString m_strName;
179 sal_uInt32 m_nZIndex;
184 sal_uInt32 m_nFrameFlag;
186};
187
189{
191}
192
193inline void XFFrame::SetName(const OUString& name)
194{
195 m_strName = name;
196}
197
198inline void XFFrame::SetX(double x)
199{
200 m_aRect.SetX(x);
201}
202
203inline void XFFrame::SetY(double y)
204{
205 m_aRect.SetY(y);
206}
207
208inline void XFFrame::SetWidth(double width)
209{
210 m_aRect.SetWidth(width);
211}
212
213inline void XFFrame::SetHeight(double height)
214{
215 m_aRect.SetHeight(height);
218}
219
220inline void XFFrame::SetMinHeight(double minHeight)
221{
222 m_fMinHeight = minHeight;
225}
226
227inline void XFFrame::SetPosition(double x, double y, double width, double height)
228{
230 m_aRect.SetSize(width,height);
232}
233
234inline void XFFrame::SetPosition(const XFRect& rect)
235{
236 m_aRect = rect;
237}
238
239inline void XFFrame::SetNextLink(const OUString& next)
240{
241 m_strNextLink = next;
242}
243
244inline void XFFrame::SetAnchorPage(sal_Int32 page)
245{
246 m_nAnchorPage = page;
247}
248
249#endif
250
251/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Stream wrapper for sax writer.
Definition: ixfstream.hxx:72
A container for content.
virtual void Add(XFContent *pContent)
@descr Add content.
@descr Base class for all content object.
Definition: xfcontent.hxx:80
Base class for all frame object,include drawing,image,text-box.
Definition: xfframe.hxx:79
void SetWidth(double width)
@descr Set frame width.
Definition: xfframe.hxx:208
void SetHeight(double height)
@descr Set frame height.
Definition: xfframe.hxx:213
enumXFAnchor m_eAnchor
Definition: xfframe.hxx:176
void SetName(const OUString &name)
@descr Set frame name.
Definition: xfframe.hxx:193
void SetY(double y)
@descr Set frame position Y.
Definition: xfframe.hxx:203
void SetAnchorPage(sal_Int32 page)
@descr: if it's page anchor,set the page number.
Definition: xfframe.hxx:244
virtual enumXFContent GetContentType() override
@descr Get content type, enumXFContentFrame.
Definition: xfframe.cxx:114
virtual ~XFFrame() override
Definition: xfframe.cxx:81
void SetAnchorType(enumXFAnchor type)
@descr: Set the anchor type for the frame object.
Definition: xfframe.hxx:188
void SetMinHeight(double minHeight)
@descr Set frame min-height.
Definition: xfframe.hxx:220
static void EndFrame(IXFStream *pStrm)
Definition: xfframe.cxx:180
enumXFFrameType GetFrameType() const
@descr Get the frame type.
Definition: xfframe.cxx:109
void AdjustZIndex()
Definition: xfframe.cxx:185
void SetX(double x)
@descr Set frame position X.
Definition: xfframe.hxx:198
enumXFFrameType m_eType
Definition: xfframe.hxx:183
XFRect m_aRect
Definition: xfframe.hxx:180
bool m_isTextBox
Definition: xfframe.hxx:185
double m_fMinHeight
Definition: xfframe.hxx:181
void StartFrame(IXFStream *pStrm)
Definition: xfframe.cxx:128
sal_Int32 m_nAnchorPage
Definition: xfframe.hxx:177
void SetZIndex(sal_uInt32 zIndex)
@descr Set z-index of the frame.
Definition: xfframe.cxx:101
OUString m_strNextLink
Definition: xfframe.hxx:182
OUString m_strName
Definition: xfframe.hxx:178
void SetNextLink(const OUString &next)
@descr: Link the text content of the two frame.
Definition: xfframe.hxx:239
void SetPosition(double x, double y, double width, double height)
@descr Set frame position.
Definition: xfframe.hxx:227
virtual void Add(XFContent *pContent) override
@descr override the add function to adjust z-index.
Definition: xfframe.cxx:85
virtual void ToXml(IXFStream *pStrm) override
@descr serialize.
Definition: xfframe.cxx:119
XFFrame()
Definition: xfframe.cxx:66
sal_uInt32 m_nZIndex
Definition: xfframe.hxx:179
sal_uInt32 m_nFrameFlag
Definition: xfframe.hxx:184
void SetHeight(double height)
Definition: xfrect.hxx:110
void SetX(double x)
Definition: xfrect.hxx:80
void SetY(double y)
Definition: xfrect.hxx:90
void SetWidth(double width)
Definition: xfrect.hxx:100
void SetSize(double width, double height)
Definition: xfrect.hxx:125
void SetStartPoint(const XFPoint &pt)
Definition: xfrect.hxx:120
float y
float x
anchor
const char * name
ResultType type
enumXFContent
Definition: xfdefs.hxx:64
enumXFFrameType
Definition: xfdefs.hxx:107
enumXFAnchor
Definition: xfdefs.hxx:256
#define XFFRAME_FLAG_HEIGHT
Definition: xfframe.hxx:68
#define XFFRAME_FLAG_MINHEIGHT
Definition: xfframe.hxx:69