LibreOffice Module lotuswordpro (master) 1
xfliststyle.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 ordered list and unordered list.
59************************************************************************/
60#ifndef INCLUDED_LOTUSWORDPRO_INC_XFILTER_XFLISTSTYLE_HXX
61#define INCLUDED_LOTUSWORDPRO_INC_XFILTER_XFLISTSTYLE_HXX
62
63#include <xfilter/xfstyle.hxx>
64#include <xfilter/xfnumfmt.hxx>
65#include <memory>
66
67class IXFStream;
68
70{
74};
75
76/**************************************************************************
77 * @descr
78 * Bullet style wrapper,the underline bullet type can be:
79 * number,image,or bullet.
80 *************************************************************************/
82{
83public:
85
86 virtual ~XFListLevel(){}
87
88 XFListLevel(XFListLevel const &) = default;
89 XFListLevel(XFListLevel &&) = default;
90 XFListLevel & operator =(XFListLevel const &) = default;
92
94
95 void SetLevel(sal_Int16 level);
96
97 void SetDisplayLevel(sal_Int16 nDisplayLevel);
98
99 void SetIndent(double indent);
100
101 void SetMinLabelWidth(double labelWidth);
102
103 void SetMinLabelDistance(double distance);
104
105 void SetAlignType(enumXFAlignType align);
106
107 virtual void ToXml(IXFStream *pStrm);
108
109 friend class XFListStyle;
110protected:
111 sal_Int16 m_nLevel;
113 double m_fIndent;
118};
119
121{
122public:
124 {
126 }
127public:
128 void SetNumFmt(XFNumFmt const & fmt)
129 {
130 m_aNumFmt = fmt;
131 }
132
133 void SetStartValue(sal_Int16 start)
134 {
136 }
137
138 virtual void ToXml(IXFStream *pStrm) override;
139private:
141};
142
144{
145public:
147 {
149 }
150
151 void SetBulletChar(OUString const & ch)
152 {
153 m_chBullet = ch;
154 }
155 void SetPrefix(const OUString& prefix)
156 {
158 }
159 void SetSuffix(const OUString& suffix)
160 {
161 m_aNumFmt.SetSuffix(suffix);
162 }
163 void SetFontName(const OUString& name)
164 {
166 }
167
168 virtual void ToXml(IXFStream *pStrm) override;
169private:
171 OUString m_chBullet;
173};
174
175//not complete.
177{
178public:
179 virtual void ToXml(IXFStream *pStrm) override;
180private:
181};
182
183class XFListStyle : public XFStyle
184{
185public:
186 XFListStyle();
187
188 XFListStyle(const XFListStyle& other);
189
190 XFListStyle& operator=(const XFListStyle& other) = delete;
191
192 virtual ~XFListStyle() override;
193
194public:
195 void SetDisplayLevel(sal_Int32 level, sal_Int16 nShowLevel);
196
197 void SetListPosition(sal_Int32 level,
198 double indent,
199 double minLabelWidth,
200 double minLabelDistance,
202 );
203
204 void SetListBullet(sal_Int32 level,
205 OUString const & bullet_char,
206 const OUString& fontname,
207 const OUString& prefix,
208 const OUString& suffix
209 );
210
211 void SetListNumber( sal_Int32 level, XFNumFmt const & numFmt, sal_Int16 nStartValue );
212
213 virtual enumXFStyle GetStyleFamily() override
214 {
215 return enumXFStyleList;
216 }
217 virtual void ToXml(IXFStream *pStrm) override;
218
219private:
220 std::unique_ptr<XFListLevel> m_pListLevels[10];
221};
222
224{
226}
227
229{
230 m_eAlign = align;
231}
232
233inline void XFListLevel::SetLevel(sal_Int16 level)
234{
235 m_nLevel = level;
236}
237
238inline void XFListLevel::SetDisplayLevel(sal_Int16 nDisplayLevel)
239{
240 m_nDisplayLevel = nDisplayLevel;
241}
242
243inline void XFListLevel::SetIndent(double indent)
244{
245 m_fIndent = indent;
246}
247
248inline void XFListLevel::SetMinLabelWidth(double labelWidth)
249{
250 m_fMinLabelWidth = labelWidth;
251}
252
253inline void XFListLevel::SetMinLabelDistance(double distance)
254{
256}
257
258#endif
259
260/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Stream wrapper for sax writer.
Definition: ixfstream.hxx:72
virtual void ToXml(IXFStream *pStrm) override
OUString m_strFontName
void SetFontName(const OUString &name)
void SetPrefix(const OUString &prefix)
void SetSuffix(const OUString &suffix)
void SetBulletChar(OUString const &ch)
virtual void ToXml(IXFStream *pStrm) override
void SetDisplayLevel(sal_Int16 nDisplayLevel)
XFListLevel(XFListLevel const &)=default
double m_fMinLabelWidth
virtual void ToXml(IXFStream *pStrm)
Definition: xfliststyle.cxx:74
enumXFListLevel m_eListType
void SetIndent(double indent)
sal_Int16 m_nLevel
void SetLevel(sal_Int16 level)
double m_fIndent
void SetMinLabelDistance(double distance)
sal_Int16 m_nDisplayLevel
void SetMinLabelWidth(double labelWidth)
void SetListlevelType(enumXFListLevel type)
XFListLevel(XFListLevel &&)=default
enumXFAlignType m_eAlign
XFListLevel & operator=(XFListLevel const &)=default
void SetAlignType(enumXFAlignType align)
double m_fMinLabelDistance
virtual ~XFListLevel()
Definition: xfliststyle.hxx:86
void SetListNumber(sal_Int32 level, XFNumFmt const &numFmt, sal_Int16 nStartValue)
void SetListBullet(sal_Int32 level, OUString const &bullet_char, const OUString &fontname, const OUString &prefix, const OUString &suffix)
virtual void ToXml(IXFStream *pStrm) override
std::unique_ptr< XFListLevel > m_pListLevels[10]
XFListStyle & operator=(const XFListStyle &other)=delete
void SetDisplayLevel(sal_Int32 level, sal_Int16 nShowLevel)
virtual ~XFListStyle() override
virtual enumXFStyle GetStyleFamily() override
@descr get style family.
void SetListPosition(sal_Int32 level, double indent, double minLabelWidth, double minLabelDistance, enumXFAlignType align=enumXFAlignStart)
void SetNumFmt(XFNumFmt const &fmt)
virtual void ToXml(IXFStream *pStrm) override
Definition: xfliststyle.cxx:78
void SetStartValue(sal_Int16 start)
Bullet number format.
Definition: xfnumfmt.hxx:71
void SetStartValue(sal_Int16 start)
Definition: xfnumfmt.hxx:125
void SetPrefix(const OUString &prefix)
Definition: xfnumfmt.hxx:85
void SetSuffix(const OUString &suffix)
Definition: xfnumfmt.hxx:96
implements ixfstyle interface.
Definition: xfstyle.hxx:70
double distance
const char * name
ResultType type
enumXFStyle
Definition: xfdefs.hxx:80
@ enumXFStyleList
Definition: xfdefs.hxx:84
enumXFAlignType
Definition: xfdefs.hxx:172
@ enumXFAlignStart
Definition: xfdefs.hxx:174
enumXFListLevel
Definition: xfliststyle.hxx:70
@ enumXFListLevelNumber
Definition: xfliststyle.hxx:72
@ enumXFListLevelBullet
Definition: xfliststyle.hxx:71
@ enumXFListLevelImage
Definition: xfliststyle.hxx:73