LibreOffice Module lotuswordpro (master) 1
xfframestyle.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 style for OOo.
59 * You can reference to the XFFrame object.
60 ************************************************************************/
61#ifndef INCLUDED_LOTUSWORDPRO_INC_XFILTER_XFFRAMESTYLE_HXX
62#define INCLUDED_LOTUSWORDPRO_INC_XFILTER_XFFRAMESTYLE_HXX
63
64#include <xfilter/xfstyle.hxx>
65#include <xfilter/xfmargins.hxx>
66#include <xfilter/xfcolor.hxx>
67#include <xfilter/xfpadding.hxx>
68#include <memory>
69
70class XFBorders;
71class XFColumns;
72class XFShadow;
73class XFBGImage;
74
79class XFFrameStyle : public XFStyle
80{
81public:
83
84 virtual ~XFFrameStyle() override;
85
86public:
87 void SetWrapType(enumXFWrap wrap);
88
92 void SetMargins(double left, double right, double top, double bottom);
93
97 void SetPadding(double left, double right, double top, double bottom);
98
102 void SetBorders(std::unique_ptr<XFBorders> pBorders);
103
107 void SetColumns(XFColumns *pColumns);
108
112 void SetShadow(XFShadow *pShadow);
113
117 void SetBackImage(std::unique_ptr<XFBGImage>& rImage);
118
122 void SetBackColor(XFColor const & color);
123
127 void SetProtect(bool content, bool size, bool pos);
128
132 void SetTextDir(enumXFTextDir dir);
133
138
143
144 void SetTransparency(sal_Int16 nTransparency);
145
146 virtual enumXFStyle GetStyleFamily() override;
147
148 virtual void ToXml(IXFStream *pStrm) override;
149
150protected:
154 std::unique_ptr<XFBorders> m_pBorders;
155 std::unique_ptr<XFColumns> m_pColumns;
156 std::unique_ptr<XFShadow> m_pShadow;
157 std::unique_ptr<XFBGImage> m_pBGImage;
163
169};
170
172{
173 m_eWrap = wrap;
174}
175
176inline void XFFrameStyle::SetMargins(double left, double right,double top, double bottom)
177{
178 if( left != -1 )
180 if( right != -1 )
182 if( top != -1 )
184 if( bottom != -1 )
186}
187
188inline void XFFrameStyle::SetPadding(double left, double right,double top, double bottom)
189{
190 if( left != -1 )
192 if( right != -1 )
194 if( top != -1 )
196 if( bottom != -1 )
198}
199
201{
203}
204
206{
207 m_eTextDir = dir;
208}
209
210inline void XFFrameStyle::SetProtect(bool content, bool size, bool pos)
211{
212 m_bProtectContent = content;
215}
216
218{
219 m_eXPos = pos;
220 m_eXRel = rel;
221}
222
224{
225 m_eYPos = pos;
226 m_eYRel = rel;
227}
228
229inline void XFFrameStyle::SetTransparency(sal_Int16 nTransparency)
230{
231 m_nTransparency = nTransparency;
232}
233
234#endif
235
236/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Stream wrapper for sax writer.
Definition: ixfstream.hxx:72
Background image object.
Definition: xfbgimage.hxx:70
Borders for object with borders.
Definition: xfborders.hxx:134
Color object.
Definition: xfcolor.hxx:70
Style for all frame objects.
void SetYPosType(enumXFFrameYPos pos, enumXFFrameYRel rel)
@descr Set vertical position type.
void SetTransparency(sal_Int16 nTransparency)
void SetTextDir(enumXFTextDir dir)
@descr Set text dir.
void SetMargins(double left, double right, double top, double bottom)
@descr: space between frame and paragraph text.
std::unique_ptr< XFBorders > m_pBorders
XFColor m_aBackColor
bool m_bProtectContent
void SetColumns(XFColumns *pColumns)
@descr: set the column property of the frame.
std::unique_ptr< XFColumns > m_pColumns
enumXFFrameXPos m_eXPos
sal_Int16 m_nTransparency
XFMargins m_aMargins
void SetWrapType(enumXFWrap wrap)
void SetProtect(bool content, bool size, bool pos)
@descr Set whether frame is protected.
std::unique_ptr< XFShadow > m_pShadow
enumXFTextDir m_eTextDir
std::unique_ptr< XFBGImage > m_pBGImage
void SetXPosType(enumXFFrameXPos pos, enumXFFrameXRel rel)
@descr Set horizontal position type.
void SetBackColor(XFColor const &color)
@descr: set the background color of the frame.
void SetShadow(XFShadow *pShadow)
@descr: set the shadow object the frame.
XFPadding m_aPad
virtual void ToXml(IXFStream *pStrm) override
enumXFFrameYPos m_eYPos
virtual ~XFFrameStyle() override
void SetBorders(std::unique_ptr< XFBorders > pBorders)
@descr: set the border property of the frame.
void SetBackImage(std::unique_ptr< XFBGImage > &rImage)
@descr: set the background image of the frame.
enumXFFrameXRel m_eXRel
enumXFWrap m_eWrap
void SetPadding(double left, double right, double top, double bottom)
@descr: space between frame and text inside frame.
enumXFFrameYRel m_eYRel
virtual enumXFStyle GetStyleFamily() override
@descr get style family.
void SetLeft(double left)
Definition: xfmargins.hxx:96
void SetRight(double right)
Definition: xfmargins.hxx:102
void SetBottom(double bottom)
Definition: xfmargins.hxx:114
void SetTop(double top)
Definition: xfmargins.hxx:108
Paddings for paragraph,frame, ...
Definition: xfpadding.hxx:76
void SetBottom(double bottom)
@descr Set padding bottom.
Definition: xfpadding.hxx:153
void SetLeft(double left)
@descr Set padding left.
Definition: xfpadding.hxx:135
void SetTop(double top)
@descr Set padding top.
Definition: xfpadding.hxx:147
void SetRight(double right)
@descr Set padding right.
Definition: xfpadding.hxx:141
Shadow object.
Definition: xfshadow.hxx:72
implements ixfstyle interface.
Definition: xfstyle.hxx:70
OString right
OString top
OString bottom
size
sal_uInt64 left
size_t pos
enumXFWrap
Definition: xfdefs.hxx:266
enumXFStyle
Definition: xfdefs.hxx:80
enumXFFrameYPos
Definition: xfdefs.hxx:329
enumXFFrameYRel
Definition: xfdefs.hxx:315
enumXFFrameXPos
Definition: xfdefs.hxx:307
enumXFTextDir
Definition: xfdefs.hxx:277
enumXFFrameXRel
Definition: xfdefs.hxx:290