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  *  For LWP filter architecture prototype
59  ************************************************************************/
60 
61 #ifndef INCLUDED_LOTUSWORDPRO_SOURCE_FILTER_LWPPARAPROPERTY_HXX
62 #define INCLUDED_LOTUSWORDPRO_SOURCE_FILTER_LWPPARAPROPERTY_HXX
63 
64 #include <memory>
65 #include <lwpobjstrm.hxx>
66 
67 #include <lwpoverride.hxx>
68 #include "lwpbackgroundoverride.hxx"
69 #include "lwpbreaksoverride.hxx"
70 #include "lwpnumberingoverride.hxx"
71 #include "lwpparaborderoverride.hxx"
72 #include "lwptaboverride.hxx"
73 
74 /* paragraph property ID's */
75 #define PP_OUTLINE_SHOW         0x53484f4cUL    /* "SHOW" */
76 #define PP_OUTLINE_HIDE         0x48494445UL    /* "HIDE" */
77 #define PP_LOCAL_ALIGN          0x414c494eUL    /* "ALIN" */
78 #define PP_LOCAL_INDENT         0x494e444eUL    /* "INDN" */
79 #define PP_LOCAL_SPACING        0x5350434eUL    /* "SPCN" */
80 #define PP_LOCAL_TABRACK        0x54414253UL    /* "TABS" */
81 #define PP_LOCAL_BREAKS         0x42524b53UL    /* "BRKS" */
82 #define PP_LOCAL_BULLET         0x42554c4cUL    /* "BULL" */
83 #define PP_LOCAL_BORDER         0x424f5244UL    /* "BORD" */
84 #define PP_LOCAL_BACKGROUND     0x4241434bUL    /* "BACK" */
85 #define PP_LOCAL_NUMBERING      0x4e4d4252UL    /* "NMBR" */
86 #define PP_LOCAL_KINSOKU        0x4b494e53UL    /* "KINS" */
87 #define PP_PROPLIST             0x50524f50UL    /* "PROP" */
88 
89 class LwpParaProperty
90 {
91 public:
LwpParaProperty()92     LwpParaProperty(){}
~LwpParaProperty()93     virtual ~LwpParaProperty() {}
94     virtual sal_uInt32  GetType() = 0;
95 };
96 
97 //align/indent/spacing
98 //TO DO:border/background etc
99 
100 class LwpParaAlignProperty : public LwpParaProperty
101 {
102 public:
103         explicit LwpParaAlignProperty(LwpObjectStream* pFile);
104         virtual ~LwpParaAlignProperty() override;
105         LwpAlignmentOverride* GetAlignment();
106         sal_uInt32  GetType() override;
107 
108 private:
109         LwpAlignmentOverride* m_pAlignment;
110 };
111 
GetAlignment()112 inline LwpAlignmentOverride* LwpParaAlignProperty::GetAlignment()
113 {
114     return m_pAlignment;
115 }
116 
117 class LwpParaIndentProperty : public LwpParaProperty
118 {
119 public:
120         explicit LwpParaIndentProperty(LwpObjectStream* pFile);
121         virtual ~LwpParaIndentProperty() override;
122         LwpIndentOverride* GetIndent();
123         sal_uInt32 GetType() override;
124         inline const LwpObjectID& GetIndentID() const;
125 
126 private:
127         LwpObjectID m_aIndentID;
128         LwpIndentOverride* m_pIndent;
129 };
GetIndentID() const130 inline const LwpObjectID& LwpParaIndentProperty::GetIndentID() const
131 {
132     return m_aIndentID;
133 }
GetIndent()134 inline LwpIndentOverride* LwpParaIndentProperty::GetIndent()
135 {
136     return m_pIndent;
137 }
138 
139 class LwpParaSpacingProperty : public LwpParaProperty
140 {
141 public:
142         explicit LwpParaSpacingProperty(LwpObjectStream* pFile);
143         virtual ~LwpParaSpacingProperty() override;
144         LwpSpacingOverride* GetSpacing();
145         sal_uInt32 GetType() override;
146 private:
147         LwpSpacingOverride* m_pSpacing;
148 
149 };
150 
GetSpacing()151 inline LwpSpacingOverride* LwpParaSpacingProperty::GetSpacing()
152 {
153     return m_pSpacing;
154 }
155 
156 class LwpParaBorderOverride;
157 class LwpParaBorderProperty : public LwpParaProperty
158 {
159 public:
160     explicit LwpParaBorderProperty(LwpObjectStream* pStrm);
161 
GetType()162     sal_uInt32 GetType() override { return PP_LOCAL_BORDER; }
163 
164     inline LwpParaBorderOverride* GetLocalParaBorder();
165 
166 private:
167     LwpParaBorderOverride* m_pParaBorderOverride;
168 };
169 
GetLocalParaBorder()170 inline LwpParaBorderOverride* LwpParaBorderProperty::GetLocalParaBorder()
171 {
172     return m_pParaBorderOverride;
173 }
174 
175 class LwpParaBreaksProperty : public LwpParaProperty
176 {
177 public:
178     explicit LwpParaBreaksProperty(LwpObjectStream* pStrm);
179 
GetType()180     sal_uInt32 GetType() override { return PP_LOCAL_BREAKS; }
181 
182     inline LwpBreaksOverride* GetLocalParaBreaks();
183 
184 private:
185     LwpBreaksOverride* m_pBreaks;
186 
187 };
188 
GetLocalParaBreaks()189 inline LwpBreaksOverride* LwpParaBreaksProperty::GetLocalParaBreaks()
190 {
191     return m_pBreaks;
192 }
193 
194 class LwpParaBulletProperty : public LwpParaProperty
195 {
196 public:
197     explicit LwpParaBulletProperty(LwpObjectStream* pStrm);
198 
199     virtual ~LwpParaBulletProperty() override;
200 
GetType()201     sal_uInt32 GetType() override { return PP_LOCAL_BULLET; }
202 
203     inline LwpBulletOverride* GetLocalParaBullet();
204 
205 private:
206     std::unique_ptr<LwpBulletOverride> m_pBullet;
207 };
208 
GetLocalParaBullet()209 inline LwpBulletOverride* LwpParaBulletProperty::GetLocalParaBullet()
210 {
211     return m_pBullet.get();
212 }
213 
214 class LwpParaNumberingProperty : public LwpParaProperty
215 {
216 public:
217     explicit LwpParaNumberingProperty(LwpObjectStream* pStrm);
218 
GetType()219     sal_uInt32 GetType() override { return PP_LOCAL_NUMBERING; }
220 
221     inline LwpNumberingOverride* GetLocalNumbering() const;
222 private:
223     LwpNumberingOverride* m_pNumberingOverride;
224 };
225 
GetLocalNumbering() const226 inline LwpNumberingOverride* LwpParaNumberingProperty::GetLocalNumbering() const
227 {
228     return m_pNumberingOverride;
229 }
230 
231 class LwpParaTabRackProperty : public LwpParaProperty
232 {
233 public:
234     explicit LwpParaTabRackProperty(LwpObjectStream* pStrm);
235     virtual ~LwpParaTabRackProperty() override;
GetType()236     sal_uInt32 GetType() override { return PP_LOCAL_TABRACK; }
237 
238     inline LwpTabOverride* GetTab();
239 
240 private:
241     LwpTabOverride* m_pTabOverride;
242 };
243 
GetTab()244 inline LwpTabOverride* LwpParaTabRackProperty::GetTab()
245 {
246     return m_pTabOverride;
247 }
248 
249 class LwpParaBackGroundProperty : public LwpParaProperty
250 {
251 public:
252     explicit LwpParaBackGroundProperty(LwpObjectStream* pFile);
253     virtual ~LwpParaBackGroundProperty() override;
254     LwpBackgroundOverride* GetBackground();
255     sal_uInt32 GetType() override;
256 private:
257     LwpBackgroundOverride* m_pBackground;
258 };
259 
GetBackground()260 inline LwpBackgroundOverride* LwpParaBackGroundProperty::GetBackground()
261 {
262     return m_pBackground;
263 }
264 
GetType()265 inline sal_uInt32 LwpParaBackGroundProperty::GetType()
266 {
267     return PP_LOCAL_BACKGROUND;
268 }
269 
270 #endif
271 
272 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
273