merge the formfield patch from ooo-build
[ooovba.git] / lotuswordpro / source / filter / lwpbreaksoverride.hxx
blobd0d9f2eee29d94ed06b858a271f230fc019bf610
1 /*************************************************************************
3 * The Contents of this file are made available subject to the terms of
4 * either of the following licenses
6 * - GNU Lesser General Public License Version 2.1
7 * - Sun Industry Standards Source License Version 1.1
9 * Sun Microsystems Inc., October, 2000
11 * GNU Lesser General Public License Version 2.1
12 * =============================================
13 * Copyright 2000 by Sun Microsystems, Inc.
14 * 901 San Antonio Road, Palo Alto, CA 94303, USA
16 * This library is free software; you can redistribute it and/or
17 * modify it under the terms of the GNU Lesser General Public
18 * License version 2.1, as published by the Free Software Foundation.
20 * This library is distributed in the hope that it will be useful,
21 * but WITHOUT ANY WARRANTY; without even the implied warranty of
22 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
23 * Lesser General Public License for more details.
25 * You should have received a copy of the GNU Lesser General Public
26 * License along with this library; if not, write to the Free Software
27 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
28 * MA 02111-1307 USA
31 * Sun Industry Standards Source License Version 1.1
32 * =================================================
33 * The contents of this file are subject to the Sun Industry Standards
34 * Source License Version 1.1 (the "License"); You may not use this file
35 * except in compliance with the License. You may obtain a copy of the
36 * License at http://www.openoffice.org/license.html.
38 * Software provided under this License is provided on an "AS IS" basis,
39 * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
40 * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
41 * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
42 * See the License for the specific provisions governing your rights and
43 * obligations concerning the Software.
45 * The Initial Developer of the Original Code is: IBM Corporation
47 * Copyright: 2008 by IBM Corporation
49 * All Rights Reserved.
51 * Contributor(s): _______________________________________
54 ************************************************************************/
55 /*************************************************************************
56 * @file
57 * Breaks override of Wordpro.
58 ************************************************************************/
59 /*************************************************************************
60 * Change History
61 * 2005-01-12 Create and implement.
62 ************************************************************************/
63 #ifndef _LWPBREAKSOVERRIDE_HXX
64 #define _LWPBREAKSOVERRIDE_HXX
66 #include "lwpoverride.hxx"
68 class LwpObjectStream;
69 class LwpAtomHolder;
70 class LwpBreaksOverride : public LwpOverride
73 public:
74 LwpBreaksOverride();
75 virtual ~LwpBreaksOverride();
77 enum
79 BO_PAGEBEFORE = 0x01, // page break before this style
80 BO_PAGEAFTER = 0x02, // page break after this style
81 BO_KEEPTOGETHER = 0x04,
82 BO_COLBEFORE = 0x08, // col break before this style
83 BO_COLAFTER = 0x10, // col break after this style
84 BO_KEEPPREV = 0x20, // not with-PAGE BEF, COL BEF or WITHIN
85 BO_KEEPNEXT = 0x40, // not with-PAGE AFT, COL AFT or WITHIN
86 BO_USENEXTSTYLE = 0x80, // use next style name
87 BO_NEXTSTYLE = 0x100 // next style name
89 public:
90 virtual void Read(LwpObjectStream *pStrm);
92 //add by , 01/28/2005
93 void Override(LwpBreaksOverride* pOther);
95 void operator=(const LwpOverride& rOther);
97 inline sal_Bool IsPageBreakBefore();
98 inline sal_Bool IsPageBreakAfter();
99 inline sal_Bool IsPageBreakWithin();
100 inline sal_Bool IsColumnBreakBefore();
101 inline sal_Bool IsColumnBreakAfter();
102 inline sal_Bool IsKeepWithNext();
103 inline sal_Bool IsKeepWithPrevious();
104 inline sal_Bool IsUseNextStyle();
106 inline sal_Bool IsPageBreakBeforeOverridden();
107 inline sal_Bool IsPageBreakAfterOverridden();
108 inline sal_Bool IsPageBreakWithinOverridden();
109 inline sal_Bool IsColumnBreakBeforeOverridden();
110 inline sal_Bool IsColumnBreakAfterOverridden();
111 inline sal_Bool IsKeepWithNextOverridden();
112 inline sal_Bool IsKeepWithPreviousOverridden();
113 inline sal_Bool IsUseNextStyleOverridden();
115 inline void RevertPageBreakBefore();
116 inline void RevertPageBreakAfter();
117 inline void RevertPageBreakWithin();
118 inline void RevertColumnBreakBefore();
119 inline void RevertColumnBreakAfter();
120 inline void RevertKeepWithNext();
121 inline void RevertKeepWithPrevious();
122 inline void RevertUseNextStyle();
125 void OverridePageBreakBefore(sal_Bool bVal);
126 void OverridePageBreakAfter(sal_Bool bVal);
127 void OverridePageBreakWithin(sal_Bool bVal);
128 void OverrideColumnBreakBefore(sal_Bool bVal);
129 void OverrideColumnBreakAfter(sal_Bool bVal);
130 void OverrideKeepWithNext(sal_Bool bVal);
131 void OverrideKeepWithPrevious(sal_Bool bVal);
132 void OverrideUseNextStyle(sal_Bool bVal);
135 inline LwpAtomHolder* GetNextStyle();
136 //end add
138 private:
139 LwpAtomHolder *m_pNextStyle;
142 inline sal_Bool LwpBreaksOverride::IsPageBreakBefore()
144 return (sal_Bool)((m_nValues & BO_PAGEBEFORE) != 0);
147 inline sal_Bool LwpBreaksOverride::IsPageBreakAfter()
149 return (sal_Bool)((m_nValues & BO_PAGEAFTER) != 0);
151 inline sal_Bool LwpBreaksOverride::IsPageBreakWithin()
153 return (sal_Bool)((m_nValues & BO_KEEPTOGETHER) != 0);
155 inline sal_Bool LwpBreaksOverride::IsColumnBreakBefore()
157 return (sal_Bool)((m_nValues & BO_COLBEFORE) != 0);
159 inline sal_Bool LwpBreaksOverride::IsColumnBreakAfter()
161 return (sal_Bool)((m_nValues & BO_COLAFTER) != 0);
163 inline sal_Bool LwpBreaksOverride::IsKeepWithNext()
165 return (sal_Bool)((m_nValues & BO_KEEPNEXT) != 0);
167 inline sal_Bool LwpBreaksOverride::IsKeepWithPrevious()
169 return (sal_Bool)((m_nValues & BO_KEEPPREV) != 0);
171 inline sal_Bool LwpBreaksOverride::IsUseNextStyle()
173 return (sal_Bool)((m_nValues & BO_USENEXTSTYLE) != 0);
176 inline sal_Bool LwpBreaksOverride::IsPageBreakBeforeOverridden()
178 return (sal_Bool)((m_nOverride& BO_PAGEBEFORE) != 0);
180 inline sal_Bool LwpBreaksOverride::IsPageBreakAfterOverridden()
182 return (sal_Bool)((m_nOverride& BO_PAGEAFTER) != 0);
184 inline sal_Bool LwpBreaksOverride::IsPageBreakWithinOverridden()
186 return (sal_Bool)((m_nOverride& BO_KEEPTOGETHER) != 0);
188 inline sal_Bool LwpBreaksOverride::IsColumnBreakBeforeOverridden()
190 return (sal_Bool)((m_nOverride& BO_COLBEFORE) != 0);
192 inline sal_Bool LwpBreaksOverride::IsColumnBreakAfterOverridden()
194 return (sal_Bool)((m_nOverride& BO_COLAFTER) != 0);
196 inline sal_Bool LwpBreaksOverride::IsKeepWithNextOverridden()
198 return (sal_Bool)((m_nOverride& BO_KEEPNEXT) != 0);
200 inline sal_Bool LwpBreaksOverride::IsKeepWithPreviousOverridden()
202 return (sal_Bool)((m_nOverride& BO_KEEPPREV) != 0);
204 inline sal_Bool LwpBreaksOverride::IsUseNextStyleOverridden()
206 return (sal_Bool)((m_nOverride& BO_USENEXTSTYLE) != 0);
209 inline void LwpBreaksOverride::RevertPageBreakBefore()
211 LwpOverride::Override(BO_PAGEBEFORE, STATE_STYLE);
213 inline void LwpBreaksOverride::RevertPageBreakAfter()
215 LwpOverride::Override(BO_PAGEAFTER, STATE_STYLE);
217 inline void LwpBreaksOverride::RevertPageBreakWithin()
219 LwpOverride::Override(BO_KEEPTOGETHER, STATE_STYLE);
221 inline void LwpBreaksOverride::RevertColumnBreakBefore()
223 LwpOverride::Override(BO_COLBEFORE, STATE_STYLE);
225 inline void LwpBreaksOverride::RevertColumnBreakAfter()
227 LwpOverride::Override(BO_COLAFTER, STATE_STYLE);
229 inline void LwpBreaksOverride::RevertKeepWithNext()
231 LwpOverride::Override(BO_KEEPNEXT, STATE_STYLE);
233 inline void LwpBreaksOverride::RevertKeepWithPrevious()
235 LwpOverride::Override(BO_KEEPPREV, STATE_STYLE);
237 inline void LwpBreaksOverride::RevertUseNextStyle()
239 LwpOverride::Override(BO_USENEXTSTYLE, STATE_STYLE);
242 inline LwpAtomHolder* LwpBreaksOverride::GetNextStyle()
244 return m_pNextStyle;
248 #endif