1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*************************************************************************
4 * The Contents of this file are made available subject to the terms of
5 * either of the following licenses
7 * - GNU Lesser General Public License Version 2.1
8 * - Sun Industry Standards Source License Version 1.1
10 * Sun Microsystems Inc., October, 2000
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
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.
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.
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,
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.
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.
46 * The Initial Developer of the Original Code is: IBM Corporation
48 * Copyright: 2008 by IBM Corporation
50 * All Rights Reserved.
52 * Contributor(s): _______________________________________
55 ************************************************************************/
56 /*************************************************************************
58 * Breaks override of Wordpro.
59 ************************************************************************/
60 #ifndef INCLUDED_LOTUSWORDPRO_SOURCE_FILTER_LWPBREAKSOVERRIDE_HXX
61 #define INCLUDED_LOTUSWORDPRO_SOURCE_FILTER_LWPBREAKSOVERRIDE_HXX
64 #include <lwpoverride.hxx>
66 class LwpObjectStream
;
68 class LwpBreaksOverride final
: public LwpOverride
72 virtual ~LwpBreaksOverride() override
;
74 virtual LwpBreaksOverride
* clone() const override
;
78 BO_PAGEBEFORE
= 0x01, // page break before this style
79 BO_PAGEAFTER
= 0x02, // page break after this style
80 BO_KEEPTOGETHER
= 0x04,
81 BO_COLBEFORE
= 0x08, // col break before this style
82 BO_COLAFTER
= 0x10, // col break after this style
83 BO_KEEPPREV
= 0x20, // not with-PAGE BEF, COL BEF or WITHIN
84 BO_KEEPNEXT
= 0x40, // not with-PAGE AFT, COL AFT or WITHIN
85 BO_USENEXTSTYLE
= 0x80, // use next style name
86 BO_NEXTSTYLE
= 0x100 // next style name
90 virtual void Read(LwpObjectStream
* pStrm
) override
;
92 void Override(LwpBreaksOverride
* pOther
);
94 inline bool IsPageBreakBefore() const;
95 inline bool IsPageBreakAfter() const;
96 inline bool IsPageBreakWithin() const;
97 inline bool IsColumnBreakBefore() const;
98 inline bool IsColumnBreakAfter() const;
99 inline bool IsKeepWithNext() const;
100 inline bool IsKeepWithPrevious() const;
101 inline bool IsUseNextStyle() const;
103 inline bool IsPageBreakBeforeOverridden() const;
104 inline bool IsPageBreakAfterOverridden() const;
105 inline bool IsPageBreakWithinOverridden() const;
106 inline bool IsColumnBreakBeforeOverridden() const;
107 inline bool IsColumnBreakAfterOverridden() const;
108 inline bool IsKeepWithNextOverridden() const;
109 inline bool IsKeepWithPreviousOverridden() const;
110 inline bool IsUseNextStyleOverridden() const;
112 inline void RevertPageBreakBefore();
113 inline void RevertPageBreakAfter();
114 inline void RevertPageBreakWithin();
115 inline void RevertColumnBreakBefore();
116 inline void RevertColumnBreakAfter();
117 inline void RevertKeepWithNext();
118 inline void RevertKeepWithPrevious();
119 inline void RevertUseNextStyle();
121 void OverridePageBreakBefore(bool bVal
);
122 void OverridePageBreakAfter(bool bVal
);
123 void OverridePageBreakWithin(bool bVal
);
124 void OverrideColumnBreakBefore(bool bVal
);
125 void OverrideColumnBreakAfter(bool bVal
);
126 void OverrideKeepWithNext(bool bVal
);
127 void OverrideKeepWithPrevious(bool bVal
);
128 void OverrideUseNextStyle(bool bVal
);
131 LwpBreaksOverride(LwpBreaksOverride
const& rOther
);
132 LwpBreaksOverride
& operator=(const LwpBreaksOverride
& rOther
) = delete;
134 std::unique_ptr
<LwpAtomHolder
> m_pNextStyle
;
137 inline bool LwpBreaksOverride::IsPageBreakBefore() const
139 return ((m_nValues
& BO_PAGEBEFORE
) != 0);
142 inline bool LwpBreaksOverride::IsPageBreakAfter() const
144 return ((m_nValues
& BO_PAGEAFTER
) != 0);
146 inline bool LwpBreaksOverride::IsPageBreakWithin() const
148 return ((m_nValues
& BO_KEEPTOGETHER
) != 0);
150 inline bool LwpBreaksOverride::IsColumnBreakBefore() const
152 return ((m_nValues
& BO_COLBEFORE
) != 0);
154 inline bool LwpBreaksOverride::IsColumnBreakAfter() const
156 return ((m_nValues
& BO_COLAFTER
) != 0);
158 inline bool LwpBreaksOverride::IsKeepWithNext() const { return ((m_nValues
& BO_KEEPNEXT
) != 0); }
159 inline bool LwpBreaksOverride::IsKeepWithPrevious() const
161 return ((m_nValues
& BO_KEEPPREV
) != 0);
163 inline bool LwpBreaksOverride::IsUseNextStyle() const
165 return ((m_nValues
& BO_USENEXTSTYLE
) != 0);
168 inline bool LwpBreaksOverride::IsPageBreakBeforeOverridden() const
170 return ((m_nOverride
& BO_PAGEBEFORE
) != 0);
172 inline bool LwpBreaksOverride::IsPageBreakAfterOverridden() const
174 return ((m_nOverride
& BO_PAGEAFTER
) != 0);
176 inline bool LwpBreaksOverride::IsPageBreakWithinOverridden() const
178 return ((m_nOverride
& BO_KEEPTOGETHER
) != 0);
180 inline bool LwpBreaksOverride::IsColumnBreakBeforeOverridden() const
182 return ((m_nOverride
& BO_COLBEFORE
) != 0);
184 inline bool LwpBreaksOverride::IsColumnBreakAfterOverridden() const
186 return ((m_nOverride
& BO_COLAFTER
) != 0);
188 inline bool LwpBreaksOverride::IsKeepWithNextOverridden() const
190 return ((m_nOverride
& BO_KEEPNEXT
) != 0);
192 inline bool LwpBreaksOverride::IsKeepWithPreviousOverridden() const
194 return ((m_nOverride
& BO_KEEPPREV
) != 0);
196 inline bool LwpBreaksOverride::IsUseNextStyleOverridden() const
198 return ((m_nOverride
& BO_USENEXTSTYLE
) != 0);
201 inline void LwpBreaksOverride::RevertPageBreakBefore()
203 LwpOverride::Override(BO_PAGEBEFORE
, STATE_STYLE
);
205 inline void LwpBreaksOverride::RevertPageBreakAfter()
207 LwpOverride::Override(BO_PAGEAFTER
, STATE_STYLE
);
209 inline void LwpBreaksOverride::RevertPageBreakWithin()
211 LwpOverride::Override(BO_KEEPTOGETHER
, STATE_STYLE
);
213 inline void LwpBreaksOverride::RevertColumnBreakBefore()
215 LwpOverride::Override(BO_COLBEFORE
, STATE_STYLE
);
217 inline void LwpBreaksOverride::RevertColumnBreakAfter()
219 LwpOverride::Override(BO_COLAFTER
, STATE_STYLE
);
221 inline void LwpBreaksOverride::RevertKeepWithNext()
223 LwpOverride::Override(BO_KEEPNEXT
, STATE_STYLE
);
225 inline void LwpBreaksOverride::RevertKeepWithPrevious()
227 LwpOverride::Override(BO_KEEPPREV
, STATE_STYLE
);
229 inline void LwpBreaksOverride::RevertUseNextStyle()
231 LwpOverride::Override(BO_USENEXTSTYLE
, STATE_STYLE
);
236 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */