build fix
[LibreOffice.git] / lotuswordpro / source / filter / lwpfoundry.hxx
blob19e6d23fdd6791a1a73faea721fbb1c80aa26d4b
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,
29 * MA 02111-1307 USA
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 /*************************************************************************
57 * @file
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>
73 class LwpDocument;
74 class LwpBookMark;
76 #include <vector>
77 #define TAG_USER_VERSION 0x72655655UL // "UVer"
79 class LwpVersionManager
81 public:
82 LwpVersionManager() = delete;
83 static void Read(LwpObjectStream *pStrm);
84 static void Skip(LwpObjectStream *pStrm);
87 class LwpObjectManager
89 public:
90 LwpObjectManager(){}
91 ~LwpObjectManager(){}
92 private:
93 LwpObjectID m_Division;
94 public:
95 void Read(LwpObjectStream *pStrm);
98 class LwpNumberManager
100 public:
101 LwpNumberManager(){}
102 ~LwpNumberManager(){}
103 private:
104 LwpObjectID m_TableRange;
105 public:
106 void Read(LwpObjectStream *pStrm);
107 const LwpObjectID& GetTableRangeID(){ return m_TableRange;}
110 class LwpBulletManager
112 public:
113 LwpBulletManager(){}
114 ~LwpBulletManager(){}
115 private:
116 LwpObjectID m_Head;
117 public:
118 void Read(LwpObjectStream *pStrm);
119 LwpObjectID& GetHeadID() { return m_Head;}
122 class LwpContent;
123 class LwpContentManager
125 public:
126 LwpContentManager(){}
127 ~LwpContentManager(){}
128 private:
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;
138 public:
139 inline LwpObjectID& GetContentList() { return m_ContentList; }
140 inline LwpObjectID& GetGraphicListHead() { return m_GrapHead; }
141 LwpContent* EnumContents(LwpContent* pContent);
143 public:
144 void Read(LwpObjectStream *pStrm);
147 class LwpPieceManager
149 public:
150 LwpPieceManager(){}
151 ~LwpPieceManager(){}
152 private:
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;
178 public:
179 void Read(LwpObjectStream *pStrm);
182 class LwpOrderedObject;
183 class LwpListList;
184 class LwpOrderedObjectManager
186 public:
187 LwpOrderedObjectManager(){}
188 ~LwpOrderedObjectManager(){}
189 protected:
190 LwpObjectID m_Head;
191 public:
192 void Read(LwpObjectStream *pStrm);
193 LwpOrderedObject* Enumerate(LwpOrderedObject* pLast);
194 protected:
195 LwpListList* GetNextActiveListList(LwpListList* pLast);
198 class LwpStyleManager;
199 class LwpSection;
200 class LwpBulletStyleMgr;
201 class LwpFoundry
203 public:
204 LwpFoundry( LwpObjectStream *pStrm, LwpDocument* pDoc );
205 ~LwpFoundry();
206 void Read(LwpObjectStream *pStrm);
207 void RegisterAllLayouts();
208 private:
209 LwpDocument* m_pDoc;
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;
255 private:
256 void ReadStyles(LwpObjectStream *pStrm);
257 public:
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() ;
267 private:
268 LwpStyleManager* m_pStyleMgr;
269 LwpDropcapMgr* m_pDropcapMgr;
270 LwpBulletStyleMgr* m_pBulletStyleMgr;
271 public:
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
285 public:
286 LwpStyleManager();
287 ~LwpStyleManager();
288 private:
289 LwpFoundry* m_pFoundry;
290 struct hashFunc
292 size_t operator()( const LwpObjectID& rName ) const
294 return rName.HashCode();
297 struct eqFunc
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;
307 public:
308 void SetFoundry(LwpFoundry* pFoundry){m_pFoundry = pFoundry;}
309 void AddStyle(LwpObjectID styleObjID, IXFStyle* pStyle);
310 IXFStyle* GetStyle(const LwpObjectID &styleObjID);
312 #endif
314 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */