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 ************************************************************************/
61 #ifndef INCLUDED_LOTUSWORDPRO_SOURCE_FILTER_LWPFOUNDRY_HXX
62 #define INCLUDED_LOTUSWORDPRO_SOURCE_FILTER_LWPFOUNDRY_HXX
64 #include "lwpheader.hxx"
65 #include "lwpobjid.hxx"
66 #include "lwpobjstrm.hxx"
67 #include "lwpcolor.hxx"
68 #include "lwpbasetype.hxx"
69 #include "lwpfont.hxx"
70 #include "lwpdropcapmgr.hxx"
71 #include <unordered_map>
77 #define TAG_USER_VERSION 0x72655655UL // "UVer"
79 class LwpVersionManager
82 LwpVersionManager() = delete;
83 static void Read(LwpObjectStream
*pStrm
);
84 static void Skip(LwpObjectStream
*pStrm
);
87 class LwpObjectManager
93 LwpObjectID m_Division
;
95 void Read(LwpObjectStream
*pStrm
);
98 class LwpNumberManager
102 ~LwpNumberManager(){}
104 LwpObjectID m_TableRange
;
106 void Read(LwpObjectStream
*pStrm
);
107 const LwpObjectID
& GetTableRangeID(){ return m_TableRange
;}
110 class LwpBulletManager
114 ~LwpBulletManager(){}
118 void Read(LwpObjectStream
*pStrm
);
119 LwpObjectID
& GetHeadID() { return m_Head
;}
123 class LwpContentManager
126 LwpContentManager(){}
127 ~LwpContentManager(){}
129 LwpObjectID m_ContentList
;
130 LwpObjectID m_EnumHead
;
131 LwpObjectID m_EnumTail
;
132 LwpObjectID m_OleObjCount
;
134 LwpObjectID m_GrapHead
;
135 LwpObjectID m_GrapTail
;
136 LwpObjectID m_OleHead
;
137 LwpObjectID m_OleTail
;
139 inline LwpObjectID
& GetContentList() { return m_ContentList
; }
140 inline LwpObjectID
& GetGraphicListHead() { return m_GrapHead
; }
141 LwpContent
* EnumContents(LwpContent
* pContent
);
144 void Read(LwpObjectStream
*pStrm
);
147 class LwpPieceManager
153 LwpObjectID m_GeometryPieceList
;
154 LwpObjectID m_ScalePieceList
;
155 LwpObjectID m_MarginsPieceList
;
156 LwpObjectID m_ColumnsPieceList
;
157 LwpObjectID m_BorderStuffPieceList
;
158 LwpObjectID m_GutterStuffPieceList
;
159 LwpObjectID m_BackgroundStuffPieceList
;
160 LwpObjectID m_JoinStuffPieceList
;
161 LwpObjectID m_ShadowPieceList
;
162 LwpObjectID m_NumericsPieceList
;
163 LwpObjectID m_RelativityPieceList
;
164 LwpObjectID m_AlignmentPieceList
;
165 LwpObjectID m_IndentPieceList
;
166 LwpObjectID m_ParaBorderPieceList
;
167 LwpObjectID m_SpacingPieceList
;
168 LwpObjectID m_BreaksPieceList
;
169 LwpObjectID m_NumberingPieceList
;
170 LwpObjectID m_TabPieceList
;
171 LwpObjectID m_CharacterBorderPieceList
;
172 LwpObjectID m_AmikakePieceList
;
174 LwpObjectID m_ParaBackgroundPieceList
;
175 LwpObjectID m_ExternalBorderStuffPieceList
;
176 LwpObjectID m_ExternalJoinStuffPieceList
;
179 void Read(LwpObjectStream
*pStrm
);
182 class LwpOrderedObject
;
184 class LwpOrderedObjectManager
187 LwpOrderedObjectManager(){}
188 ~LwpOrderedObjectManager(){}
192 void Read(LwpObjectStream
*pStrm
);
193 LwpOrderedObject
* Enumerate(LwpOrderedObject
* pLast
);
195 LwpListList
* GetNextActiveListList(LwpListList
* pLast
);
198 class LwpStyleManager
;
200 class LwpBulletStyleMgr
;
204 LwpFoundry( LwpObjectStream
*pStrm
, LwpDocument
* pDoc
);
206 void Read(LwpObjectStream
*pStrm
);
207 void RegisterAllLayouts();
210 bool m_bRegisteredAll
;
211 private: //file members
212 LwpObjectManager m_ObjMgr
;
213 LwpObjectID m_MarkerHead
;
214 LwpObjectID m_FootnoteMgr
;
215 LwpNumberManager m_NumMgr
;
216 LwpBulletManager m_BulMgr
;
217 LwpOrderedObjectManager m_SectionList
;
219 LwpObjectID m_Layout
; //The head layout
220 LwpObjectID m_TextStyle
;
221 LwpObjectID m_DefaultTextStyle
;
222 LwpObjectID m_DefaultClickStyle
;
223 LwpObjectID m_PageStyle
;
224 LwpObjectID m_FrameStyle
;
225 LwpObjectID m_TableStyle
;
226 LwpObjectID m_CellStyle
;
227 LwpObjectID m_DftFrameStyle
;
228 LwpObjectID m_DftPageStyle
;
229 LwpObjectID m_DftTableStyle
;
230 LwpObjectID m_DftCellStyle
;
231 LwpObjectID m_DftColumnStyle
;
232 LwpObjectID m_DftLeftColumnStyle
;
233 LwpObjectID m_DftRighColumnStyle
;
235 LwpObjectID m_BookMarkHead
;
236 LwpObjectID m_DdeLinkHead
;
237 LwpObjectID m_DirtBagHead
;
238 LwpObjectID m_NamedOutlineSeqHead
;
239 LwpObjectID m_EnumLayoutHead
;
240 LwpObjectID m_EnumLayoutTail
;
242 LwpObjectID m_NamedObjects
;
243 sal_uInt32 m_nLastClickHere
;
245 LwpObjectID m_SmartTextMgr
;
247 LwpContentManager m_ContentMgr
;
248 LwpFontManager m_FontMgr
;
249 LwpPieceManager
* m_pPieceMgr
;
251 LwpObjectID m_DftDropCapStyle
;
252 LwpObjectID m_DftHeaderStyle
;
254 LwpObjectID m_DftFooterStyle
;
256 void ReadStyles(LwpObjectStream
*pStrm
);
258 inline LwpContentManager
& GetContentManager() { return m_ContentMgr
; }
259 inline LwpObjectID
& GetGraphicListHead() { return m_ContentMgr
.GetGraphicListHead(); }
260 inline LwpFontManager
& GetFontManger() { return m_FontMgr
;}
261 inline LwpObjectID
& GetTextStyleHead() { return m_TextStyle
;}
262 inline LwpObjectID
& GetLayout() {return m_Layout
;}
263 inline LwpObjectID
& GetBulletManagerID() { return m_BulMgr
.GetHeadID();}
264 inline LwpDocument
* GetDocument(){ return m_pDoc
;}
265 inline LwpNumberManager
& GetNumberManager() { return m_NumMgr
;}
266 LwpObjectID
* GetDefaultTextStyle() ;
268 LwpStyleManager
* m_pStyleMgr
;
269 LwpDropcapMgr
* m_pDropcapMgr
;
270 LwpBulletStyleMgr
* m_pBulletStyleMgr
;
272 inline LwpStyleManager
* GetStyleManager() { return m_pStyleMgr
;}
273 LwpBookMark
* GetBookMark(LwpObjectID objMarker
);
274 LwpDropcapMgr
* GetDropcapMgr(){return m_pDropcapMgr
;}
275 LwpContent
* EnumContents(LwpContent
* pContent
);
276 LwpSection
* EnumSections(LwpSection
* pSection
);
277 LwpBulletStyleMgr
* GetBulletStyleMgr(){return m_pBulletStyleMgr
;}
279 LwpObjectID
* FindParaStyleByName(const OUString
& name
);
280 OUString
FindActuralStyleName(const OUString
& name
);
283 class LwpStyleManager
289 LwpFoundry
* m_pFoundry
;
292 size_t operator()( const LwpObjectID
& rName
) const
294 return rName
.HashCode();
299 bool operator()( const LwpObjectID
& rKey1
, const LwpObjectID
& rKey2
) const
301 return(rKey1
==rKey2
);
305 typedef std::unordered_map
<LwpObjectID
, IXFStyle
*, hashFunc
, eqFunc
> LwpStyleMap
;
306 LwpStyleMap m_StyleList
;
308 void SetFoundry(LwpFoundry
* pFoundry
){m_pFoundry
= pFoundry
;}
309 void AddStyle(LwpObjectID styleObjID
, IXFStyle
* pStyle
);
310 IXFStyle
* GetStyle(const LwpObjectID
&styleObjID
);
314 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */