LibreOffice Module lotuswordpro (master) 1
xfparastyle.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 * Styles for paragraph.
59 * Styles for paragraph may include many style,include font,indent,margin,
60 * shadow,line height,and so on.
61 ************************************************************************/
62#ifndef INCLUDED_LOTUSWORDPRO_INC_XFILTER_XFPARASTYLE_HXX
63#define INCLUDED_LOTUSWORDPRO_INC_XFILTER_XFPARASTYLE_HXX
64
65#include <sal/config.h>
66
67#include <rtl/ref.hxx>
68
69#include <xfilter/xffont.hxx>
70#include <xfilter/xfstyle.hxx>
71#include <xfilter/xfcolor.hxx>
72#include <xfilter/xfmargins.hxx>
73#include <xfilter/xfbreaks.hxx>
74#include <xfilter/xfpadding.hxx>
75#include <xfilter/xfshadow.hxx>
76#include <xfilter/xfdropcap.hxx>
79#include <memory>
80
81#define XFPARA_FLAG_FONT 0X00000001
82#define XFPARA_FLAG_DROPCAP 0X00000002
83#define XFPARA_FLAG_BACKCOLOR 0X00000004
84
85class XFBorders;
86class XFBGImage;
87
92class XFParaStyle : public XFStyle
93{
94public:
96
97 XFParaStyle(const XFParaStyle& other);
98
99 XFParaStyle& operator=(const XFParaStyle& other);
100
101 virtual ~XFParaStyle() override;
102
103public:
108 void SetMasterPage(const OUString& master);
109
110 const OUString& GetMasterPage() const;
111
117 void SetFont(rtl::Reference<XFFont> const & font);
118
122 const rtl::Reference<XFFont>& GetFont() const { return m_pFont; }
123
129 void SetIndent(double indent );
130
136 void SetPadding(double left, double right, double top, double bottom);
137
143 void SetMargins(double left, double right,double top=-1, double bottom=-1);
144
149 void SetAlignType(enumXFAlignType eAlign);
150
158 void SetShadow(enumXFShadowPos pos, double offset, XFColor const & color);
159
166 void SetBorders(XFBorders *pBorders);
167
173 void SetDropCap(sal_Int16 nLength, sal_Int16 nLines, double fDistance = 0);
174
180 void SetLineHeight(enumLHType type, double value);
181
186 void SetBackColor(XFColor const & color);
187
192 void SetBackImage(std::unique_ptr<XFBGImage>& rImage);
193
197 void SetBreaks(enumXFBreaks breaks);
198
202 void AddTabStyle(enumXFTab type, double len, sal_Unicode leader, sal_Unicode delimiter);
203
207 void ClearTabStyles();
208
210
211 virtual enumXFStyle GetStyleFamily() override;
212
213 virtual bool Equal(IXFStyle *pStyle) override;
214
215 virtual void ToXml(IXFStream *strm) override;
216
217 void SetNumberRight(bool bFlag){m_bNumberRight = bFlag;}
218 bool GetNumberRight() const {return m_bNumberRight;}
219
220private:
223
231 std::unique_ptr<XFBorders> m_pBorders;
232 std::unique_ptr<XFBGImage> m_pBGImage;
236
237 sal_uInt32 m_nFlag;
239};
240
241inline void XFParaStyle::SetMasterPage(const OUString& master)
242{
244}
245
247{
248 m_aBreaks.SetBreakType(breaks);
249}
250
251inline void XFParaStyle::SetPadding(double left, double right, double top, double bottom)
252{
254 if( right == -1 )
256 else
258 if( top == -1 )
260 else
262 if( bottom == -1 )
264 else
266}
267
269{
270 m_eAlignType = eAlign;
271}
272
274{
275 m_aTabs.Reset();
276}
277
278inline const OUString& XFParaStyle::GetMasterPage() const
279{
280 return m_strMasterPage;
281}
282
283
285{
286public:
288 void SetTabDistance(double len);
289 enumXFStyle GetStyleFamily() override;
290 virtual void ToXml(IXFStream *pStrm) override;
291private:
293};
294
296{
297 m_fTabDistance = len;
298}
299
300#endif
301/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Stream wrapper for sax writer.
Definition: ixfstream.hxx:72
@descr Interface for all style object.
Definition: ixfstyle.hxx:71
Background image object.
Definition: xfbgimage.hxx:70
Borders for object with borders.
Definition: xfborders.hxx:134
@descr Page|Column break object.
Definition: xfbreaks.hxx:71
void SetBreakType(enumXFBreaks breaks)
@descr Set break type, pls refer to enumXFBreaks.
Definition: xfbreaks.hxx:95
Color object.
Definition: xfcolor.hxx:70
enumXFStyle GetStyleFamily() override
@descr get style family.
void SetTabDistance(double len)
virtual void ToXml(IXFStream *pStrm) override
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
Style object for aragraph.
Definition: xfparastyle.hxx:93
OUString m_strMasterPage
virtual void ToXml(IXFStream *strm) override
void SetPadding(double left, double right, double top, double bottom)
@descr Set the padding of the paragraph.
XFMargins & GetMargins()
bool m_bNumberRight
void SetIndent(double indent)
@descr Set the indent of the paragraph.
void SetBreaks(enumXFBreaks breaks)
descr You can only set one break property for every para style object.
XFMargins m_aMargin
void SetDropCap(sal_Int16 nLength, sal_Int16 nLines, double fDistance=0)
@descr Set drop caption of the paragraph.
XFBreaks m_aBreaks
std::unique_ptr< XFBGImage > m_pBGImage
void SetMargins(double left, double right, double top=-1, double bottom=-1)
@descr Set the Margins of the paragraph.
const OUString & GetMasterPage() const
enumXFAlignType m_eAlignType
void SetLineHeight(enumLHType type, double value)
@descr Set line height of the paragraph.
XFStyleContainer m_aTabs
XFShadow m_aShadow
virtual ~XFParaStyle() override
bool GetNumberRight() const
void SetMasterPage(const OUString &master)
@descr Set layout for the paragraph.
sal_uInt32 m_nFlag
const rtl::Reference< XFFont > & GetFont() const
@descr get the font object.
std::unique_ptr< XFBorders > m_pBorders
XFParaStyle & operator=(const XFParaStyle &other)
virtual enumXFStyle GetStyleFamily() override
@descr get style family.
XFDropcap m_aDropcap
void SetShadow(enumXFShadowPos pos, double offset, XFColor const &color)
@descr Set the shadow of the paragraph.
double m_fTextIndent
rtl::Reference< XFFont > m_pFont
virtual bool Equal(IXFStyle *pStyle) override
Affirm whether two XFParaStyle objects are equal.
XFColor m_aBackColor
void SetFont(rtl::Reference< XFFont > const &font)
@descr set the paragraph default font.
void SetBackImage(std::unique_ptr< XFBGImage > &rImage)
@descr Set background image of the paragraph.
void AddTabStyle(enumXFTab type, double len, sal_Unicode leader, sal_Unicode delimiter)
@descr Add a tab style.
void SetNumberRight(bool bFlag)
void ClearTabStyles()
@descr for para style copy operator, sometimes you may need to override tab styles.
void SetBorders(XFBorders *pBorders)
@descr The borders is complex, so you have to create one before use.
XFLineHeight m_aLineHeight
void SetAlignType(enumXFAlignType eAlign)
@descr Set alignment property of the paragraph.
XFPadding m_aPadding
void SetBackColor(XFColor const &color)
@descr Set background color of the paragraph.
Shadow object.
Definition: xfshadow.hxx:72
@descr container object for styles.
Definition: xfstylecont.hxx:85
void Reset()
@descr clear container.
Definition: xfstylecont.cxx:78
implements ixfstyle interface.
Definition: xfstyle.hxx:70
OString right
OString top
OString bottom
sal_uInt16 sal_Unicode
sal_uInt64 left
enumXFShadowPos
Definition: xfdefs.hxx:185
enumXFStyle
Definition: xfdefs.hxx:80
enumXFBreaks
Definition: xfdefs.hxx:220
enumLHType
Definition: xfdefs.hxx:211
enumXFAlignType
Definition: xfdefs.hxx:172
enumXFTab
Definition: xfdefs.hxx:230