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 * For LWP filter architecture prototype
59 ************************************************************************/
60 /*************************************************************************
63 ************************************************************************/
65 #ifndef INCLUDED_LOTUSWORDPRO_SOURCE_FILTER_LWPFOUNDRY_HXX
66 #define INCLUDED_LOTUSWORDPRO_SOURCE_FILTER_LWPFOUNDRY_HXX
68 #include "lwpheader.hxx"
69 #include "lwpobjid.hxx"
70 #include "lwpobjstrm.hxx"
71 #include "lwpcolor.hxx"
72 #include "lwpbasetype.hxx"
73 #include "lwpfont.hxx"
74 #include "lwpdropcapmgr.hxx"
75 #include <unordered_map>
81 #define TAG_USER_VERSION 0x72655655UL // "UVer"
83 class LwpVersionManager
87 ~LwpVersionManager(){}
89 static void Read(LwpObjectStream
*pStrm
);
90 static void Skip(LwpObjectStream
*pStrm
);
93 class LwpObjectManager
99 LwpObjectID m_Division
;
101 void Read(LwpObjectStream
*pStrm
);
104 class LwpNumberManager
108 ~LwpNumberManager(){}
110 LwpObjectID m_TableRange
;
112 void Read(LwpObjectStream
*pStrm
);
113 LwpObjectID
GetTableRangeID(){ return m_TableRange
;}
116 class LwpBulletManager
120 ~LwpBulletManager(){}
124 void Read(LwpObjectStream
*pStrm
);
125 LwpObjectID
& GetHeadID() { return m_Head
;}
129 class LwpContentManager
132 LwpContentManager(){}
133 ~LwpContentManager(){}
135 LwpObjectID m_ContentList
;
136 LwpObjectID m_EnumHead
;
137 LwpObjectID m_EnumTail
;
138 LwpObjectID m_OleObjCount
;
140 LwpObjectID m_GrapHead
;
141 LwpObjectID m_GrapTail
;
142 LwpObjectID m_OleHead
;
143 LwpObjectID m_OleTail
;
145 inline LwpObjectID
& GetContentList() { return m_ContentList
; }
146 inline LwpObjectID
& GetGraphicListHead() { return m_GrapHead
; }
147 LwpContent
* EnumContents(LwpContent
* pContent
);
150 void Read(LwpObjectStream
*pStrm
);
153 class LwpPieceManager
159 LwpObjectID m_GeometryPieceList
;
160 LwpObjectID m_ScalePieceList
;
161 LwpObjectID m_MarginsPieceList
;
162 LwpObjectID m_ColumnsPieceList
;
163 LwpObjectID m_BorderStuffPieceList
;
164 LwpObjectID m_GutterStuffPieceList
;
165 LwpObjectID m_BackgroundStuffPieceList
;
166 LwpObjectID m_JoinStuffPieceList
;
167 LwpObjectID m_ShadowPieceList
;
168 LwpObjectID m_NumericsPieceList
;
169 LwpObjectID m_RelativityPieceList
;
170 LwpObjectID m_AlignmentPieceList
;
171 LwpObjectID m_IndentPieceList
;
172 LwpObjectID m_ParaBorderPieceList
;
173 LwpObjectID m_SpacingPieceList
;
174 LwpObjectID m_BreaksPieceList
;
175 LwpObjectID m_NumberingPieceList
;
176 LwpObjectID m_TabPieceList
;
177 LwpObjectID m_CharacterBorderPieceList
;
178 LwpObjectID m_AmikakePieceList
;
180 LwpObjectID m_ParaBackgroundPieceList
;
181 LwpObjectID m_ExternalBorderStuffPieceList
;
182 LwpObjectID m_ExternalJoinStuffPieceList
;
185 void Read(LwpObjectStream
*pStrm
);
188 class LwpOrderedObject
;
190 class LwpOrderedObjectManager
193 LwpOrderedObjectManager(){}
194 ~LwpOrderedObjectManager(){}
198 void Read(LwpObjectStream
*pStrm
);
199 LwpObjectID
& GetHeadID() { return m_Head
;}
200 LwpOrderedObject
* Enumerate(LwpOrderedObject
* pLast
);
202 LwpListList
* GetNextActiveListList(LwpListList
* pLast
);
205 class LwpStyleManager
;
207 class LwpBulletStyleMgr
;
211 LwpFoundry( LwpObjectStream
*pStrm
, LwpDocument
* pDoc
);
213 void Read(LwpObjectStream
*pStrm
);
214 void RegisterAllLayouts();
217 bool m_bRegisteredAll
;
218 private: //file members
219 LwpVersionManager m_VerMgr
;
220 LwpObjectManager m_ObjMgr
;
221 LwpObjectID m_MarkerHead
;
222 LwpObjectID m_FootnoteMgr
;
223 LwpNumberManager m_NumMgr
;
224 LwpBulletManager m_BulMgr
;
225 LwpOrderedObjectManager m_SectionList
;
227 LwpObjectID m_Layout
; //The head layout
228 LwpObjectID m_TextStyle
;
229 LwpObjectID m_DefaultTextStyle
;
230 LwpObjectID m_DefaultClickStyle
;
231 LwpObjectID m_PageStyle
;
232 LwpObjectID m_FrameStyle
;
233 LwpObjectID m_TableStyle
;
234 LwpObjectID m_CellStyle
;
235 LwpObjectID m_DftFrameStyle
;
236 LwpObjectID m_DftPageStyle
;
237 LwpObjectID m_DftTableStyle
;
238 LwpObjectID m_DftCellStyle
;
239 LwpObjectID m_DftColumnStyle
;
240 LwpObjectID m_DftLeftColumnStyle
;
241 LwpObjectID m_DftRighColumnStyle
;
243 LwpObjectID m_BookMarkHead
;
244 LwpObjectID m_DdeLinkHead
;
245 LwpObjectID m_DirtBagHead
;
246 LwpObjectID m_NamedOutlineSeqHead
;
247 LwpObjectID m_EnumLayoutHead
;
248 LwpObjectID m_EnumLayoutTail
;
250 LwpObjectID m_NamedObjects
;
251 sal_uInt32 m_nLastClickHere
;
253 LwpObjectID m_SmartTextMgr
;
255 LwpContentManager m_ContentMgr
;
256 LwpFontManager m_FontMgr
;
257 LwpPieceManager
* m_pPieceMgr
;
259 LwpObjectID m_DftDropCapStyle
;
260 LwpObjectID m_DftHeaderStyle
;
262 LwpObjectID m_DftFooterStyle
;
264 void ReadStyles(LwpObjectStream
*pStrm
);
266 inline LwpContentManager
& GetContentManager() { return m_ContentMgr
; }
267 inline LwpObjectID
& GetGraphicListHead() { return m_ContentMgr
.GetGraphicListHead(); }
268 inline LwpFontManager
& GetFontManger() { return m_FontMgr
;}
269 inline LwpObjectID
& GetTextStyleHead() { return m_TextStyle
;}
270 inline LwpObjectID
& GetLayout() {return m_Layout
;}
271 inline LwpObjectID
& GetBulletManagerID() { return m_BulMgr
.GetHeadID();}
272 inline LwpDocument
* GetDocument(){ return m_pDoc
;}
273 inline LwpNumberManager
& GetNumberManager() { return m_NumMgr
;}
274 LwpObjectID
* GetDefaultTextStyle() ;
276 LwpStyleManager
* m_pStyleMgr
;
277 LwpDropcapMgr
* m_pDropcapMgr
;
278 LwpBulletStyleMgr
* m_pBulletStyleMgr
;
280 inline LwpStyleManager
* GetStyleManager() { return m_pStyleMgr
;}
281 LwpBookMark
* GetBookMark(LwpObjectID objMarker
);
282 LwpDropcapMgr
* GetDropcapMgr(){return m_pDropcapMgr
;}
283 LwpContent
* EnumContents(LwpContent
* pContent
);
284 LwpSection
* EnumSections(LwpSection
* pSection
);
285 LwpBulletStyleMgr
* GetBulletStyleMgr(){return m_pBulletStyleMgr
;}
287 LwpObjectID
* FindParaStyleByName(const OUString
& name
);
288 OUString
FindActuralStyleName(const OUString
& name
);
291 class LwpStyleManager
297 LwpFoundry
* m_pFoundry
;
300 size_t operator()( const LwpObjectID
& rName
) const
302 return rName
.HashCode();
307 bool operator()( const LwpObjectID
& rKey1
, const LwpObjectID
& rKey2
) const
309 return(rKey1
==rKey2
);
313 typedef std::unordered_map
<LwpObjectID
, IXFStyle
*, hashFunc
, eqFunc
> LwpStyleMap
;
314 LwpStyleMap m_StyleList
;
316 void SetFoundry(LwpFoundry
* pFoundry
){m_pFoundry
= pFoundry
;}
317 IXFStyle
* AddStyle(LwpObjectID styleObjID
, IXFStyle
* pStyle
);
318 IXFStyle
* GetStyle(const LwpObjectID
&styleObjID
);
322 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */