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 _LWPSILVERBULLET_HXX
65 #define _LWPSILVERBULLET_HXX
67 #include "lwpheader.hxx"
69 #include "lwpdlvlist.hxx"
70 #include "lwpobjid.hxx"
71 #include "lwpatomholder.hxx"
72 //Added by yanjun for SS merge: 2007-12-21
73 #include "unicode/utypes.h"
75 const sal_uInt16 MAXNUMBERPOSITIONS
= 10; //max number of positions
76 const sal_uInt16 NUMCHAR_none
= 0x00; //none of numberchar
77 const sal_uInt16 NUMCHAR_1
= 0x01; //index for numberchar "1"
78 const sal_uInt16 NUMCHAR_A
= 0x02; //index for numberchar "A"
79 const sal_uInt16 NUMCHAR_a
= 0x03; //index for numberchar "a"
80 const sal_uInt16 NUMCHAR_I
= 0x04; //index for numberchar "I"
81 const sal_uInt16 NUMCHAR_i
= 0x05; //index for numberchar "i"
82 const sal_uInt16 NUMCHAR_other
= 0x06; //index for numberchar "other"
83 const sal_uInt16 NUMCHAR_01
= 0x0B; //index for numberchar "01"
85 const sal_uInt16 NUMCHAR_Chinese1
= 0x09; //index for numberchar "Ҽ"
86 const sal_uInt16 NUMCHAR_Chinese2
= 0x08; //index for numberchar "һ"
87 const sal_uInt16 NUMCHAR_Chinese3
= 0x0A; //index for numberchar "¼×"
88 const sal_uInt16 NUMCHAR_Chinese4
= 0x13; //index for numberchar "01" in chinese version
94 class LwpFribParaNumber
;
96 class LwpSilverBullet
: public LwpDLNFVList
99 LwpSilverBullet(LwpObjectHeader
& objHdr
, LwpSvStream
* pStrm
);
101 virtual ~LwpSilverBullet();
103 virtual void RegisterStyle();
107 sal_Bool
IsBulletOrdered();
109 rtl::OUString
GetBulletFontName();
111 inline rtl::OUString
GetBulletStyleName() const;
113 UChar32
GetBulletChar();
115 rtl::OUString
GetPrefix();
117 rtl::OUString
GetSuffix();
119 inline rtl::OUString
GetNumberingName();
121 inline LwpPara
* GetNumberingPara();
125 static rtl::OUString
GetNumCharByStyleID(LwpFribParaNumber
* pParaNumber
);
127 inline sal_Bool
IsPosCumulative(sal_uInt16 nHideLevels
);
128 inline sal_Bool
IsLesserLevel(sal_uInt16 nPos
);
129 inline sal_Bool
IsNewSection(sal_uInt16 nPos
);
131 LwpPara
* GetBulletPara();
133 sal_uInt16
GetDisplayLevel(sal_uInt8 nPos
);
135 rtl::OUString
GetAdditionalName(sal_uInt8 nPos
);
137 rtl::OUString
GetDivisionName();
139 rtl::OUString
GetSectionName();
143 LwpObjectID m_aStory
;
144 sal_uInt8 m_pResetPositionFlags
[MAXNUMBERPOSITIONS
];
145 sal_uInt32 m_nUseCount
;
146 LwpAtomHolder
* m_pAtomHolder
;
148 LwpPara
* m_pBulletPara
;
149 rtl::OUString m_strStyleName
;
150 sal_uInt16 m_pHideLevels
[10];
153 enum // For m_pResetPositionFlags
156 LESSERSPECIFIC
= 0x02,
162 inline rtl::OUString
LwpSilverBullet::GetBulletStyleName() const
164 return m_strStyleName
;
167 inline rtl::OUString
LwpSilverBullet::GetNumberingName()
169 return GetName()->str();
171 inline LwpPara
* LwpSilverBullet::GetNumberingPara()
173 return m_pBulletPara
;
175 inline sal_Bool
LwpSilverBullet::IsPosCumulative(sal_uInt16 nHideLevels
)
177 sal_uInt16 AttrMask
= ~nHideLevels
;
178 return (sal_Bool
)((AttrMask
& (AttrMask
- 1)) != 0);
180 inline sal_Bool
LwpSilverBullet::IsLesserLevel(sal_uInt16 nPos
)
182 return (sal_Bool
)((m_pResetPositionFlags
[nPos
] & LESSERLEVEL
) != 0);
184 inline sal_Bool
LwpSilverBullet::IsNewSection(sal_uInt16 nPos
)
186 return (sal_Bool
)((m_pResetPositionFlags
[nPos
] & NEWSECTION
) != 0);