LibreOffice Module lotuswordpro (master) 1
lwpparaborderoverride.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* Border override of Wordpro.
59************************************************************************/
60#ifndef INCLUDED_LOTUSWORDPRO_SOURCE_FILTER_LWPPARABORDEROVERRIDE_HXX
61#define INCLUDED_LOTUSWORDPRO_SOURCE_FILTER_LWPPARABORDEROVERRIDE_HXX
62
63#include <lwpoverride.hxx>
64
65class LwpBorderStuff;
66class LwpShadow;
67class LwpMargins;
68
70{
71public:
73 virtual ~LwpParaBorderOverride() override;
74
75 virtual LwpParaBorderOverride* clone() const override;
76
78 {
79 PB_NONE = 0, /* No border */
80 PB_TEXTWIDTH = 1, /* Border is width of text */
81 PB_MARGINWIDTH = 2, /* Border extends to margins */
82 PB_CUSTOMWIDTH = 3 /* Border width is specified explicitly */
83 };
84 virtual void Read(LwpObjectStream *pStrm) override;
85
86 LwpShadow* GetShadow(){ return m_pShadow.get(); }
88 LwpMargins* GetMargins() { return m_pMargins.get(); };
89
90 void Override(LwpParaBorderOverride* pOther);
91
92 inline bool IsBorderStuffOverridden() const;
93 inline bool IsBetweenStuffOverridden() const;
94 inline bool IsShadowOverridden() const;
95 inline bool IsMarginsOverridden() const;
96 inline bool IsAboveTypeOverridden() const;
97 inline bool IsBelowTypeOverridden() const;
98 inline bool IsRightTypeOverridden() const;
99 inline bool IsBetweenTypeOverridden() const;
100 inline bool IsAboveWidthOverridden() const;
101 inline bool IsBelowWidthOverridden() const;
102 inline bool IsBetweenWidthOverridden() const;
103 inline bool IsRightWidthOverridden() const;
104 inline bool IsBetweenMarginOverridden() const;
105
106 void OverrideBorderStuff(LwpBorderStuff const * pBorderStuff);
107 void OverrideBetweenStuff(LwpBorderStuff const * pBorderStuff);
108 void OverrideShadow(LwpShadow const * pShadow);
109 void OverrideMargins(LwpMargins const * pMargins);
110 void OverrideAboveType(BorderWidthType eNewType);
111 void OverrideBelowType(BorderWidthType eNewType);
112 void OverrideRightType(BorderWidthType eNewType);
114 void OverrideAboveWidth(sal_uInt32 nNewWidth);
115 void OverrideBelowWidth(sal_uInt32 nNewWidth);
116 void OverrideBetweenWidth(sal_uInt32 nNewWidth);
117 void OverrideRightWidth(sal_uInt32 nNewWidth);
118 void OverrideBetweenMargin(sal_uInt32 nNewMargin);
119
120 inline void RevertBorderStuff();
121 inline void RevertBetweenStuff();
122 inline void RevertShadow();
123 inline void RevertMargins();
124 inline void RevertAboveType();
125 inline void RevertBelowType();
126 inline void RevertRightType();
127 inline void RevertBetweenType();
128 inline void RevertAboveWidth();
129 inline void RevertBelowWidth();
130 inline void RevertBetweenWidth();
131 inline void RevertRightWidth();
132 inline void RevertBetweenMargin();
133
134 friend class LwpParaBorderPiece;
135
136private:
139
140 enum
141 {
142 PBO_STUFF = 0x0001,
143 PBO_SHADOW = 0x0002,
144 PBO_MARGINS = 0x0004,
148 PBO_ABOVE = 0x0040,
149 PBO_BELOW = 0x0080,
152 PBO_BETWEEN = 0x0400,
154 PBO_RIGHT = 0x1000
155 };
156
157 std::unique_ptr<LwpBorderStuff> m_pBorderStuff;
158 std::unique_ptr<LwpBorderStuff> m_pBetweenStuff;
159 std::unique_ptr<LwpShadow> m_pShadow;
160 std::unique_ptr<LwpMargins> m_pMargins;
161
166
167 sal_uInt32 m_nAboveWidth;
168 sal_uInt32 m_nBelowWidth;
169 sal_uInt32 m_nBetweenWidth;
170 sal_uInt32 m_nRightWidth;
171
173};
174
176{
177 return ((m_nOverride & PBO_STUFF) != 0);
178}
180{
181 return ((m_nOverride & PBO_BETWEENSTUFF) != 0);
182}
184{
185 return ((m_nOverride & PBO_SHADOW) != 0);
186}
188{
189 return ((m_nOverride & PBO_MARGINS) != 0);
190}
192{
193 return ((m_nOverride & PBO_ABOVETYPE) != 0);
194}
196{
197 return ((m_nOverride & PBO_BELOWTYPE) != 0);
198}
200{
201 return ((m_nOverride & PBO_RIGHTTYPE) != 0);
202}
204{
205 return ((m_nOverride & PBO_BETWEENTYPE) != 0);
206}
208{
209 return ((m_nOverride & PBO_ABOVE) != 0);
210}
212{
213 return ((m_nOverride & PBO_BELOW) != 0);
214}
216{
217 return ((m_nOverride & PBO_BETWEEN) != 0);
218}
220{
221 return ((m_nOverride & PBO_RIGHT) != 0);
222}
224{
225 return ((m_nOverride & PBO_BETWEENMARGIN) != 0);
226}
227
229{
231}
233{
235}
237{
239}
241{
243}
245{
247}
249{
251}
253{
255}
257{
259}
261{
263}
265{
267}
269{
271}
273{
275}
277{
279}
280
281#endif
282
283/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
stream class for LwpObject body data provide stream like interface to read object data
Definition: lwpobjstrm.hxx:77
void Override(sal_uInt16 nBits, STATE eState)
Definition: lwpoverride.cxx:92
sal_uInt16 m_nOverride
void OverrideBetweenWidth(sal_uInt32 nNewWidth)
void OverrideBorderStuff(LwpBorderStuff const *pBorderStuff)
void OverrideRightWidth(sal_uInt32 nNewWidth)
virtual ~LwpParaBorderOverride() override
void OverrideBetweenStuff(LwpBorderStuff const *pBorderStuff)
std::unique_ptr< LwpMargins > m_pMargins
void OverrideBetweenType(BorderWidthType eNewType)
void Override(LwpParaBorderOverride *pOther)
virtual LwpParaBorderOverride * clone() const override
std::unique_ptr< LwpShadow > m_pShadow
LwpParaBorderOverride & operator=(LwpParaBorderOverride const &rOther)=delete
virtual void Read(LwpObjectStream *pStrm) override
void OverrideAboveType(BorderWidthType eNewType)
LwpBorderStuff * GetBorderStuff()
void OverrideAboveWidth(sal_uInt32 nNewWidth)
void OverrideBetweenMargin(sal_uInt32 nNewMargin)
void OverrideRightType(BorderWidthType eNewType)
void OverrideMargins(LwpMargins const *pMargins)
void OverrideBelowWidth(sal_uInt32 nNewWidth)
void OverrideBelowType(BorderWidthType eNewType)
std::unique_ptr< LwpBorderStuff > m_pBetweenStuff
std::unique_ptr< LwpBorderStuff > m_pBorderStuff
void OverrideShadow(LwpShadow const *pShadow)
@ STATE_STYLE
Definition: lwpoverride.hxx:75