LibreOffice Module lotuswordpro (master) 1
lwpbreaksoverride.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* Breaks override of Wordpro.
59************************************************************************/
60#ifndef INCLUDED_LOTUSWORDPRO_SOURCE_FILTER_LWPBREAKSOVERRIDE_HXX
61#define INCLUDED_LOTUSWORDPRO_SOURCE_FILTER_LWPBREAKSOVERRIDE_HXX
62
63#include <memory>
64#include <lwpoverride.hxx>
65
66class LwpObjectStream;
67class LwpAtomHolder;
68class LwpBreaksOverride final : public LwpOverride
69{
70public:
72 virtual ~LwpBreaksOverride() override;
73
74 virtual LwpBreaksOverride* clone() const override;
75
76 enum
77 {
78 BO_PAGEBEFORE = 0x01, // page break before this style
79 BO_PAGEAFTER = 0x02, // page break after this style
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
87 };
88
89public:
90 virtual void Read(LwpObjectStream* pStrm) override;
91
92 void Override(LwpBreaksOverride* pOther);
93
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;
102
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;
111
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();
120
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);
129
130private:
133
134 std::unique_ptr<LwpAtomHolder> m_pNextStyle;
135};
136
138{
139 return ((m_nValues & BO_PAGEBEFORE) != 0);
140}
141
143{
144 return ((m_nValues & BO_PAGEAFTER) != 0);
145}
147{
148 return ((m_nValues & BO_KEEPTOGETHER) != 0);
149}
151{
152 return ((m_nValues & BO_COLBEFORE) != 0);
153}
155{
156 return ((m_nValues & BO_COLAFTER) != 0);
157}
158inline bool LwpBreaksOverride::IsKeepWithNext() const { return ((m_nValues & BO_KEEPNEXT) != 0); }
160{
161 return ((m_nValues & BO_KEEPPREV) != 0);
162}
164{
165 return ((m_nValues & BO_USENEXTSTYLE) != 0);
166}
167
169{
170 return ((m_nOverride & BO_PAGEBEFORE) != 0);
171}
173{
174 return ((m_nOverride & BO_PAGEAFTER) != 0);
175}
177{
178 return ((m_nOverride & BO_KEEPTOGETHER) != 0);
179}
181{
182 return ((m_nOverride & BO_COLBEFORE) != 0);
183}
185{
186 return ((m_nOverride & BO_COLAFTER) != 0);
187}
189{
190 return ((m_nOverride & BO_KEEPNEXT) != 0);
191}
193{
194 return ((m_nOverride & BO_KEEPPREV) != 0);
195}
197{
198 return ((m_nOverride & BO_USENEXTSTYLE) != 0);
199}
200
202{
204}
206{
208}
210{
212}
214{
216}
218{
220}
222{
224}
226{
228}
230{
232}
233
234#endif
235
236/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
AtomHolder class of Word Pro to hold a string.
void OverrideKeepWithPrevious(bool bVal)
void OverridePageBreakBefore(bool bVal)
bool IsKeepWithNextOverridden() const
void OverrideColumnBreakAfter(bool bVal)
bool IsUseNextStyleOverridden() const
bool IsPageBreakBeforeOverridden() const
virtual LwpBreaksOverride * clone() const override
LwpBreaksOverride & operator=(const LwpBreaksOverride &rOther)=delete
void OverrideColumnBreakBefore(bool bVal)
bool IsPageBreakAfter() const
void OverrideKeepWithNext(bool bVal)
void OverrideUseNextStyle(bool bVal)
bool IsPageBreakWithinOverridden() const
std::unique_ptr< LwpAtomHolder > m_pNextStyle
bool IsKeepWithNext() const
bool IsKeepWithPreviousOverridden() const
bool IsPageBreakWithin() const
void Override(LwpBreaksOverride *pOther)
bool IsColumnBreakBefore() const
bool IsColumnBreakAfter() const
void OverridePageBreakWithin(bool bVal)
bool IsColumnBreakAfterOverridden() const
bool IsPageBreakAfterOverridden() const
bool IsPageBreakBefore() const
virtual void Read(LwpObjectStream *pStrm) override
bool IsKeepWithPrevious() const
virtual ~LwpBreaksOverride() override
void OverridePageBreakAfter(bool bVal)
bool IsUseNextStyle() const
bool IsColumnBreakBeforeOverridden() const
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_nValues
sal_uInt16 m_nOverride
@ STATE_STYLE
Definition: lwpoverride.hxx:75