update dev300-m57
[ooovba.git] / lotuswordpro / source / filter / lwpfoundry.hxx
blobf9553db83bd654bb65f4fe321462c62f059d29e0
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,
28 * MA 02111-1307 USA
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 /*************************************************************************
56 * @file
57 * For LWP filter architecture prototype
58 ************************************************************************/
59 /*************************************************************************
60 * Change History
61 Jan 2005 Created
62 ************************************************************************/
64 #ifndef _LWPFOUNDRY_HXX
65 #define _LWPFOUNDRY_HXX
67 #include "lwpheader.hxx"
69 #ifndef _LWPOBJECTID_HXX
70 #include "lwpobjid.hxx"
71 #endif
73 #ifndef _LWPOBJECTSTREAM_HXX
74 #include "lwpobjstrm.hxx"
75 #endif
77 #include "lwpcolor.hxx"
78 #include "lwpbasetype.hxx"
79 #include "lwpfont.hxx"
80 #include "lwpdropcapmgr.hxx"
81 class LwpDocument;
82 class LwpBookMark;
84 #include <vector>
85 #define TAG_USER_VERSION 0x72655655UL // "UVer"
88 class LwpVersionManager
90 public:
91 LwpVersionManager(){};
92 ~LwpVersionManager(){};
93 public:
94 void Read(LwpObjectStream *pStrm);
95 void Skip(LwpObjectStream *pStrm);
98 class LwpObjectManager
100 public:
101 LwpObjectManager(){};
102 ~LwpObjectManager(){};
103 private:
104 LwpObjectID m_Division;
105 public:
106 void Read(LwpObjectStream *pStrm);
109 class LwpNumberManager
111 public:
112 LwpNumberManager(){};
113 ~LwpNumberManager(){};
114 private:
115 LwpObjectID m_TableRange;
116 public:
117 void Read(LwpObjectStream *pStrm);
118 LwpObjectID GetTableRangeID(){ return m_TableRange;}
121 class LwpBulletManager
123 public:
124 LwpBulletManager(){};
125 ~LwpBulletManager(){};
126 private:
127 LwpObjectID m_Head;
128 public:
129 void Read(LwpObjectStream *pStrm);
130 LwpObjectID* GetHeadID() { return &m_Head;}
133 class LwpContent;
134 class LwpContentManager
136 public:
137 LwpContentManager(){};
138 ~LwpContentManager(){};
139 private:
140 LwpObjectID m_ContentList;
141 LwpObjectID m_EnumHead;
142 LwpObjectID m_EnumTail;
143 LwpObjectID m_OleObjCount;
144 sal_uInt32 m_oldOleObjCount;
146 LwpObjectID m_GrapHead;
147 LwpObjectID m_GrapTail;
148 LwpObjectID m_OleHead;
149 LwpObjectID m_OleTail;
150 public:
151 inline LwpObjectID* GetContentList() { return &m_ContentList; }
152 inline LwpObjectID* GetGraphicListHead() { return &m_GrapHead; }
153 LwpContent* EnumContents(LwpContent* pContent);
155 public:
156 void Read(LwpObjectStream *pStrm);
159 class LwpPieceManager
161 public:
162 LwpPieceManager(){};
163 ~LwpPieceManager(){};
164 private:
165 LwpObjectID m_GeometryPieceList;
166 LwpObjectID m_ScalePieceList;
167 LwpObjectID m_MarginsPieceList;
168 LwpObjectID m_ColumnsPieceList;
169 LwpObjectID m_BorderStuffPieceList;
170 LwpObjectID m_GutterStuffPieceList;
171 LwpObjectID m_BackgroundStuffPieceList;
172 LwpObjectID m_JoinStuffPieceList;
173 LwpObjectID m_ShadowPieceList;
174 LwpObjectID m_NumericsPieceList;
175 LwpObjectID m_RelativityPieceList;
176 LwpObjectID m_AlignmentPieceList;
177 LwpObjectID m_IndentPieceList;
178 LwpObjectID m_ParaBorderPieceList;
179 LwpObjectID m_SpacingPieceList;
180 LwpObjectID m_BreaksPieceList;
181 LwpObjectID m_NumberingPieceList;
182 LwpObjectID m_TabPieceList;
183 LwpObjectID m_CharacterBorderPieceList;
184 LwpObjectID m_AmikakePieceList;
186 LwpObjectID m_ParaBackgroundPieceList;
187 LwpObjectID m_ExternalBorderStuffPieceList;
188 LwpObjectID m_ExternalJoinStuffPieceList;
190 public:
191 void Read(LwpObjectStream *pStrm);
194 class LwpOrderedObject;
195 class LwpListList;
196 class LwpOrderedObjectManager
198 public:
199 LwpOrderedObjectManager(){};
200 ~LwpOrderedObjectManager(){};
201 protected:
202 LwpObjectID m_Head;
203 public:
204 void Read(LwpObjectStream *pStrm);
205 LwpObjectID* GetHeadID() { return &m_Head;};
206 LwpOrderedObject* Enumerate(LwpOrderedObject* pLast);
207 protected:
208 LwpListList* GetNextActiveListList(LwpListList* pLast);
211 class LwpStyleManager;
212 class LwpSection;
213 class LwpBulletStyleMgr;
214 class LwpFoundry
216 public:
217 LwpFoundry( LwpObjectStream *pStrm, LwpDocument* pDoc );
218 ~LwpFoundry();
219 void Read(LwpObjectStream *pStrm);
220 void RegisterAllLayouts();
221 private:
222 LwpDocument* m_pDoc;
223 private: //file members
224 LwpVersionManager m_VerMgr;
225 LwpObjectManager m_ObjMgr;
226 LwpObjectID m_MarkerHead;
227 LwpObjectID m_FootnoteMgr;
228 LwpNumberManager m_NumMgr;
229 LwpBulletManager m_BulMgr;
230 LwpOrderedObjectManager m_SectionList;
232 LwpObjectID m_Layout; //The head layout
233 LwpObjectID m_TextStyle;
234 LwpObjectID m_DefaultTextStyle;
235 LwpObjectID m_DefaultClickStyle;
236 LwpObjectID m_PageStyle;
237 LwpObjectID m_FrameStyle;
238 LwpObjectID m_TableStyle;
239 LwpObjectID m_CellStyle;
240 LwpObjectID m_DftFrameStyle;
241 LwpObjectID m_DftPageStyle;
242 LwpObjectID m_DftTableStyle;
243 LwpObjectID m_DftCellStyle;
244 LwpObjectID m_DftColumnStyle;
245 LwpObjectID m_DftLeftColumnStyle;
246 LwpObjectID m_DftRighColumnStyle;
248 LwpObjectID m_BookMarkHead;
249 LwpObjectID m_DdeLinkHead;
250 LwpObjectID m_DirtBagHead;
251 LwpObjectID m_NamedOutlineSeqHead;
252 LwpObjectID m_EnumLayoutHead;
253 LwpObjectID m_EnumLayoutTail;
255 LwpObjectID m_NamedObjects;
256 sal_uInt32 m_nLastClickHere;
258 LwpObjectID m_SmartTextMgr;
260 LwpContentManager m_ContentMgr;
261 LwpFontManager m_FontMgr;
262 LwpPieceManager* m_pPieceMgr;
264 LwpObjectID m_DftDropCapStyle;
265 LwpObjectID m_DftHeaderStyle;
267 LwpObjectID m_DftFooterStyle;
268 private:
269 void ReadStyles(LwpObjectStream *pStrm);
270 public:
271 inline LwpContentManager* GetContentManager() { return &m_ContentMgr; }
272 inline LwpObjectID* GetGraphicListHead() { return m_ContentMgr.GetGraphicListHead(); }
273 inline LwpFontManager* GetFontManger() { return &m_FontMgr;}
274 inline LwpObjectID* GetTextStyleHead() { return &m_TextStyle;}
275 inline LwpObjectID* GetLayout() {return &m_Layout;}
276 inline LwpObjectID* GetBulletManagerID() { return m_BulMgr.GetHeadID();}
277 inline LwpDocument* GetDocument(){ return m_pDoc;}
278 inline LwpNumberManager* GetNumberManager() { return &m_NumMgr;}
279 LwpObjectID * GetDefaultTextStyle() ;
280 private:
281 LwpStyleManager* m_pStyleMgr;
282 LwpDropcapMgr* m_pDropcapMgr;
283 LwpBulletStyleMgr* m_pBulletStyleMgr;
284 public:
285 inline LwpStyleManager* GetStyleManager() { return m_pStyleMgr;}
286 LwpBookMark* GetBookMark(LwpObjectID objMarker);
287 sal_Bool FindBookMarkByName(OUString sName);
288 LwpDropcapMgr* GetDropcapMgr(){return m_pDropcapMgr;}
289 LwpContent* EnumContents(LwpContent* pContent);
290 LwpSection* EnumSections(LwpSection* pSection);
291 LwpBulletStyleMgr* GetBulletStyleMgr(){return m_pBulletStyleMgr;}
293 LwpObjectID* FindParaStyleByName(OUString name);
294 OUString FindActuralStyleName(OUString name);
297 class LwpStyleManager
299 public:
300 LwpStyleManager();
301 ~LwpStyleManager();
302 private:
303 LwpFoundry* m_pFoundry;
304 struct hashFunc
306 size_t operator()( const LwpObjectID& rName ) const
308 return rName.HashCode();
311 struct eqFunc
313 bool operator()( const LwpObjectID& rKey1, const LwpObjectID& rKey2 ) const
315 return(rKey1==rKey2);
319 typedef std::hash_map<LwpObjectID, IXFStyle*, hashFunc, eqFunc> LwpStyleMap;
320 LwpStyleMap m_StyleList;
321 public:
322 void SetFoundry(LwpFoundry* pFoundry){m_pFoundry = pFoundry;}
323 IXFStyle* AddStyle(LwpObjectID styleObjID, IXFStyle* pStyle);
324 IXFStyle* GetStyle(const LwpObjectID &styleObjID);
326 #endif