Line data Source code
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_SOURCE_FILTER_XFILTER_XFFRAMESTYLE_HXX
62 : #define INCLUDED_LOTUSWORDPRO_SOURCE_FILTER_XFILTER_XFFRAMESTYLE_HXX
63 :
64 : #include "xfglobal.hxx"
65 : #include "xfstyle.hxx"
66 : #include "xfmargins.hxx"
67 : #include "xfcolor.hxx"
68 : #include "xfpadding.hxx"
69 :
70 : class XFBorders;
71 : class XFColumns;
72 : class XFShadow;
73 : class XFBGImage;
74 :
75 : /**
76 : * @brief
77 : * Style for all frame objects.
78 : */
79 : class XFFrameStyle : public XFStyle
80 : {
81 : public:
82 : XFFrameStyle();
83 :
84 : virtual ~XFFrameStyle();
85 :
86 : public:
87 : void SetWrapType(enumXFWrap wrap, sal_Int32 nParagraphs = 0);
88 :
89 : /**
90 : * @descr: space between frame and paragraph text.
91 : */
92 : void SetMargins(double left, double right=-1,double top=-1, double bottom=-1);
93 :
94 : /**
95 : * @descr: space between frame and text inside frame.
96 : */
97 : void SetPadding(double left, double right=-1,double top=-1, double bottom=-1);
98 :
99 : /**
100 : * @descr: set the border property of the frame.
101 : */
102 : void SetBorders(XFBorders *pBorders);
103 :
104 : /**
105 : * @descr: set the column property of the frame.
106 : */
107 : void SetColumns(XFColumns *pColumns);
108 :
109 : /**
110 : * @descr: set the shadow object the frame.
111 : */
112 : void SetShadow(XFShadow *pShadow);
113 :
114 : /**
115 : * @descr: set the background image of the frame.
116 : */
117 : void SetBackImage(XFBGImage *iamge);
118 :
119 : /**
120 : * @descr: set the background color of the frame.
121 : */
122 : void SetBackColor(XFColor& color);
123 :
124 : /**
125 : * @descr Set whether frame is protected. There are three properties that can be protected, content,size and position.
126 : */
127 : void SetProtect(bool content, bool size, bool pos);
128 :
129 : /**
130 : * @descr Set text dir.
131 : */
132 : void SetTextDir(enumXFTextDir dir);
133 :
134 : /**
135 : * @descr Set horizontal position type.
136 : */
137 : void SetXPosType(enumXFFrameXPos pos, enumXFFrameXRel rel);
138 :
139 : /**
140 : * @descr Set vertical position type.
141 : */
142 : void SetYPosType(enumXFFrameYPos pos, enumXFFrameYRel rel);
143 :
144 : /**
145 : * @descr Set frame background.
146 : */
147 : void SetBackGround(bool bBackground);
148 :
149 : void SetTransparency(sal_Int16 nTransparency);
150 :
151 : virtual enumXFStyle GetStyleFamily() SAL_OVERRIDE;
152 :
153 : virtual void ToXml(IXFStream *pStrm) SAL_OVERRIDE;
154 :
155 : protected:
156 : enumXFWrap m_eWrap;
157 : sal_Int32 m_nWrapLines;
158 : XFPadding m_aPad;
159 : XFMargins m_aMargins;
160 : XFBorders *m_pBorders;
161 : XFColumns *m_pColumns;
162 : XFShadow *m_pShadow;
163 : XFBGImage *m_pBGImage;
164 : XFColor m_aBackColor;
165 : bool m_bProtectContent;
166 : bool m_bProtectSize;
167 : bool m_bProtectPos;
168 : bool m_bEditable;
169 : bool m_bPrintable;
170 : bool m_bBackground;
171 : sal_Int16 m_nTransparency;
172 :
173 : enumXFTextDir m_eTextDir;
174 : enumXFFrameXPos m_eXPos;
175 : enumXFFrameXRel m_eXRel;
176 : enumXFFrameYPos m_eYPos;
177 : enumXFFrameYRel m_eYRel;
178 : };
179 :
180 25 : inline void XFFrameStyle::SetWrapType(enumXFWrap wrap, sal_Int32 /*nParagraphs*/)
181 : {
182 25 : m_eWrap = wrap;
183 25 : }
184 :
185 25 : inline void XFFrameStyle::SetMargins(double left, double right,double top, double bottom)
186 : {
187 25 : if( left != -1 )
188 25 : m_aMargins.SetLeft(left);
189 25 : if( right != -1 )
190 25 : m_aMargins.SetRight(right);
191 25 : if( top != -1 )
192 25 : m_aMargins.SetTop(top);
193 25 : if( bottom != -1 )
194 25 : m_aMargins.SetBottom( bottom );
195 25 : }
196 :
197 25 : inline void XFFrameStyle::SetPadding(double left, double right,double top, double bottom)
198 : {
199 25 : if( left != -1 )
200 25 : m_aPad.SetLeft(left);
201 25 : if( right != -1 )
202 25 : m_aPad.SetRight(right);
203 25 : if( top != -1 )
204 25 : m_aPad.SetTop(top);
205 25 : if( bottom != -1 )
206 25 : m_aPad.SetBottom( bottom );
207 25 : }
208 :
209 25 : inline void XFFrameStyle::SetBackColor(XFColor& color)
210 : {
211 25 : m_aBackColor = color;
212 25 : }
213 :
214 25 : inline void XFFrameStyle::SetTextDir(enumXFTextDir dir)
215 : {
216 25 : m_eTextDir = dir;
217 25 : }
218 :
219 0 : inline void XFFrameStyle::SetProtect(bool content, bool size, bool pos)
220 : {
221 0 : m_bProtectContent = content;
222 0 : m_bProtectSize = size;
223 0 : m_bProtectPos = pos;
224 0 : }
225 :
226 31 : inline void XFFrameStyle::SetXPosType(enumXFFrameXPos pos, enumXFFrameXRel rel)
227 : {
228 31 : m_eXPos = pos;
229 31 : m_eXRel = rel;
230 31 : }
231 :
232 31 : inline void XFFrameStyle::SetYPosType(enumXFFrameYPos pos, enumXFFrameYRel rel)
233 : {
234 31 : m_eYPos = pos;
235 31 : m_eYRel = rel;
236 31 : }
237 :
238 : inline void XFFrameStyle::SetBackGround(bool bBackground)
239 : {
240 : m_bBackground = bBackground;
241 : }
242 :
243 0 : inline void XFFrameStyle::SetTransparency(sal_Int16 nTransparency)
244 : {
245 0 : m_nTransparency = nTransparency;
246 0 : }
247 :
248 : #endif
249 :
250 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|