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,
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 /*************************************************************************
57 * For LWP filter architecture prototype
58 ************************************************************************/
59 /*************************************************************************
62 ************************************************************************/
64 #ifndef _LWPUSEWHEN_HXX
65 #define _LWPUSEWHEN_HXX
67 #include "lwpheader.hxx"
69 #define STYLE_USEONALLPAGES 0x0001U /* repeat on all pages */
70 #define STYLE_USEONALLEVENPAGES 0x0002U /* repeat on all even pages */
71 #define STYLE_USEONALLODDPAGES 0x0004U /* repeat on all odd pages */
72 #define STYLE_USEONTHISPAGE 0x0008U /* use this guy on this page */
73 #define STYLE_USEEXCEPTTHISPAGE 0x0010U /* use guy except on this page */
74 #define STYLE_USESTARTINGONPAGE 0x0020U /* use starting on page n */
75 #define STYLE_USEONMASK (STYLE_USEONALLPAGES | \
76 STYLE_USEONALLEVENPAGES | \
77 STYLE_USEONALLODDPAGES | \
78 STYLE_USEONTHISPAGE | \
79 STYLE_USEEXCEPTTHISPAGE | \
80 STYLE_USESTARTINGONPAGE)
82 #define STYLE_STARTONNEXTPAGE 0x0000U // This is the default
83 #define STYLE_STARTONTHISPAGE 0x0040U
84 #define STYLE_STARTONNEXTODD 0x0080U
85 #define STYLE_STARTONNEXTEVEN 0x0100U
86 #define STYLE_STARTONTHISHF 0x0200U
87 #define STYLE_STARTONMASK (STYLE_STARTONTHISPAGE | \
88 STYLE_STARTONNEXTODD | \
89 STYLE_STARTONNEXTEVEN | \
94 LwpUseWhen() : m_nFlags(0), m_nUsePage(0) {}
96 inline void Read(LwpObjectStream
* pStrm
);
98 inline sal_Bool
IsUseOnAllPages();
100 inline sal_Bool
IsUseOnAllEvenPages();
102 inline sal_Bool
IsUseOnAllOddPages();
104 inline sal_Bool
IsUseOnPage();
106 inline sal_Bool
IsStartOnThisPage();
108 inline sal_Bool
IsStartOnNextPage();
110 inline sal_Bool
IsStartOnNextEvenPage();
112 inline sal_Bool
IsStartOnNextOddPage();
114 inline sal_Bool
IsStartOnThisHF();
116 inline sal_uInt16
GetUsePage();
119 sal_uInt16 m_nUsePage
;
122 inline void LwpUseWhen::Read(LwpObjectStream
* pStrm
)
124 pStrm
->QuickRead(&m_nFlags
, 2);
125 pStrm
->QuickRead(&m_nUsePage
, 2);
128 inline sal_Bool
LwpUseWhen::IsUseOnAllPages()
130 return (sal_Bool
)((m_nFlags
& STYLE_USEONALLPAGES
) != 0);
132 inline sal_Bool
LwpUseWhen::IsUseOnAllEvenPages()
134 return (sal_Bool
)((m_nFlags
& STYLE_USEONALLEVENPAGES
) != 0);
136 inline sal_Bool
LwpUseWhen::IsUseOnAllOddPages()
138 return (sal_Bool
)((m_nFlags
& STYLE_USEONALLODDPAGES
) != 0);
141 inline sal_Bool
LwpUseWhen::IsUseOnPage()
143 return (sal_Bool
)((m_nFlags
& STYLE_USEONTHISPAGE
) != 0);
146 inline sal_Bool
LwpUseWhen::IsStartOnThisPage()
148 return (sal_Bool
)((m_nFlags
& STYLE_STARTONTHISPAGE
) != 0);
151 inline sal_Bool
LwpUseWhen::IsStartOnNextPage()
153 return (sal_Bool
)((m_nFlags
& STYLE_STARTONMASK
) == 0);
156 inline sal_Bool
LwpUseWhen::IsStartOnNextOddPage()
158 return (sal_Bool
)((m_nFlags
& STYLE_STARTONNEXTODD
) != 0);
161 inline sal_Bool
LwpUseWhen::IsStartOnNextEvenPage()
163 return (sal_Bool
)((m_nFlags
& STYLE_STARTONNEXTEVEN
) != 0);
166 inline sal_Bool
LwpUseWhen::IsStartOnThisHF()
168 return (sal_Bool
)((m_nFlags
& STYLE_STARTONTHISHF
) != 0);
171 inline sal_uInt16
LwpUseWhen::GetUsePage()